public void Topic_is_encoded_as_first_field() { EncodedString topicName = "Test/topic"; PublishVariableHeader variableHeader = new PublishVariableHeader(topicName); byte[] encodedTopicNameBytes = variableHeader .Encode() .Take( topicName.Encode().Count()).ToArray(); for (int i = 0; i < topicName.Encode().Count(); i++) { Assert.AreEqual(topicName.Encode().ToArray()[i], encodedTopicNameBytes[i]); } }
public void Throw_exception_if_topic_name_starts_with_dollar_sign() { EncodedString topicNameForSystemMsgs = "$This/Is/Not/Allowed"; PublishVariableHeader throwExceptionHere = new PublishVariableHeader(topicNameForSystemMsgs); }
public void Throw_exception_if_wildcards_are_used_in_topic_name() { EncodedString badTopicName = "Wildcards/+/arent/allowed/#"; PublishVariableHeader throwExceptionHere = new PublishVariableHeader(badTopicName); }