예제 #1
0
        public void array_serialization_for_all_recepients_serializes_all_properties_in_correct_order()
        {
            var message = new PublishMessage(topicUri, eventObj);
            var array = message.ToArray();
            array.Length.Should().Be(3);

            array[0].Should().Be(MessageTypes.Publish);
            array[1].Should().Be(topicUri);
            array[2].Should().Be(eventObj);
        }
예제 #2
0
        public void array_serialization_with_self_exclude_serializes_all_properties_in_correct_order()
        {
            var message = new PublishMessage(topicUri, eventObj, excludeSelf);
            var array = message.ToArray();
            array.Length.Should().Be(4);

            array[0].Should().Be(MessageTypes.Publish);
            array[1].Should().Be(topicUri);
            array[2].Should().Be(eventObj);
            array[3].Should().Be(excludeSelf);
        }
예제 #3
0
        public void array_serialization_with_excludes_serializes_all_properties_in_correct_order()
        {
            var message = new PublishMessage(topicUri, eventObj, excludes, null);
            var array = message.ToArray();
            array.Length.Should().Be(4);

            array[0].Should().Be(MessageTypes.Publish);
            array[1].Should().Be(topicUri);
            array[2].Should().Be(eventObj);
            (array[3] as IEnumerable<string>).Should().BeEquivalentTo(excludes);
        }
예제 #4
0
        public void parametrized_constructor_for_all_recepients_should_assign_all_parameters()
        {
            var message = new PublishMessage(topicUri, eventObj);

            message.TopicUri.Should().Be(topicUri);
            message.EventObject.Should().Be(eventObj);
            message.ExcludeSelf.Should().BeFalse();
            message.Eligibles.Should().BeNull();
            message.Excludes.Should().BeNull();
        }
예제 #5
0
 public void message_type_implements_IMessage_interface()
 {
     var message = new PublishMessage();
     (message is IMessage).Should().BeTrue();
 }
예제 #6
0
        public void parametrized_constructor_with_self_exclude_should_assign_all_parameters()
        {
            var message = new PublishMessage(topicUri, eventObj, excludeSelf);

            message.TopicUri.Should().Be(topicUri);
            message.EventObject.Should().Be(eventObj);
            message.ExcludeSelf.Should().BeTrue();
            message.Eligibles.Should().BeNull();
            message.Excludes.Should().BeNull();
        }
예제 #7
0
        public void parametrized_constructor_with_excludes_and_eligibles_should_assign_all_parameters()
        {
            var message = new PublishMessage(topicUri, eventObj, excludes, eligibles);

            message.TopicUri.Should().Be(topicUri);
            message.EventObject.Should().Be(eventObj);
            message.ExcludeSelf.Should().BeFalse();
            message.Eligibles.Should().BeEquivalentTo(eligibles);
            message.Excludes.Should().BeEquivalentTo(excludes);
        }