public void same_message_n_times_it_should_be_handled_n_times() { var handler = new MessageWithIdHandler(); var message = new TestMessageWithId(11); Bus.Subscribe<TestMessageWithId>(handler); Bus.Publish(message); Bus.Publish(message); Bus.Publish(message); Assert.That(handler.HandledMessages.ContainsN<TestMessageWithId>(3, mes => mes.Id == 11)); }
public void same_message_n_times_it_should_be_handled_n_times() { var handler = new MessageWithIdHandler(); var message = new TestMessageWithId(11); Bus.Subscribe <TestMessageWithId>(handler); Bus.Publish(message); Bus.Publish(message); Bus.Publish(message); Assert.That(handler.HandledMessages.ContainsN <TestMessageWithId>(3, mes => mes.Id == 11)); }
public void multiple_messages_of_same_type_they_all_should_be_delivered() { var handler = new MessageWithIdHandler(); var message1 = new TestMessageWithId(1); var message2 = new TestMessageWithId(2); var message3 = new TestMessageWithId(3); Bus.Subscribe <TestMessageWithId>(handler); Bus.Publish(message1); Bus.Publish(message2); Bus.Publish(message3); Assert.That(handler.HandledMessages.ContainsSingle <TestMessageWithId>(mes => mes.Id == 1)); Assert.That(handler.HandledMessages.ContainsSingle <TestMessageWithId>(mes => mes.Id == 2)); Assert.That(handler.HandledMessages.ContainsSingle <TestMessageWithId>(mes => mes.Id == 3)); }
public void multiple_messages_of_same_type_they_all_should_be_delivered() { var handler = new MessageWithIdHandler(); var message1 = new TestMessageWithId(1); var message2 = new TestMessageWithId(2); var message3 = new TestMessageWithId(3); Bus.Subscribe<TestMessageWithId>(handler); Bus.Publish(message1); Bus.Publish(message2); Bus.Publish(message3); Assert.That(handler.HandledMessages.ContainsSingle<TestMessageWithId>(mes => mes.Id == 1)); Assert.That(handler.HandledMessages.ContainsSingle<TestMessageWithId>(mes => mes.Id == 2)); Assert.That(handler.HandledMessages.ContainsSingle<TestMessageWithId>(mes => mes.Id == 3)); }