public void Validate_OnNullChar() { // Arrange var rawTopic = Mqtt.Topic.NullCharacter.ToString(); var rule = new MustNotHaveNullChar(); // Act Action validatingRawTopic = () => rule.Validate(rawTopic); // Assert validatingRawTopic.Should() .Throw <IllegalTopicConstructionException>( "because a topic using the null char is not valid"); }
public void Validate_OnNoNullChar() { // Arrange var rawTopic = TestUtils.GenerateSingleValidTopic(); var rule = new MustNotHaveNullChar(); // Act Action validatingRawTopic = () => rule.Validate(rawTopic); // Assert validatingRawTopic.Should() .NotThrow <IllegalTopicConstructionException>( "because the raw topic is correctly formed"); }
public void Validate_OnNullCharAmongTopic() { // Arrange var rawTopic = TestUtils.GenerateSingleValidTopic() + Mqtt.Topic.NullCharacter + TestUtils.GenerateSingleValidTopic(); var rule = new MustNotHaveNullChar(); // Act Action validatingRawTopic = () => rule.Validate(rawTopic); // Assert validatingRawTopic.Should() .Throw <IllegalTopicConstructionException>( "because a topic using the null char is not valid"); }