Skip to content

Commit

Permalink
add test for unset MessageHeader.CurrentProgramName
Browse files Browse the repository at this point in the history
  • Loading branch information
rkm committed Oct 3, 2024
1 parent 3bc99de commit b89f226
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,14 @@ public void TestMessageHeader_GetHashCode()
Assert.That(h2, Is.EqualTo(h1));
Assert.That(h2.GetHashCode(), Is.EqualTo(h1.GetHashCode()));
}

[Test]
public void CurrentProgramName_Unset_ThrowsException()
{
MessageHeader.CurrentProgramName = null!;

var exc = Assert.Throws<Exception>(() => new MessageHeader());
Assert.That(exc.Message, Is.EqualTo("Value must be set before use"));
}
}
}

0 comments on commit b89f226

Please sign in to comment.