public void MessagesAreHandledInPolymorphicFashion() { var bus = new DirectDispatchMessageBus(); var target = new PolySubscriber(); bus.Subscribe(target); bus.Publish <DerivedTestMessage>(); Assert.That(target.MessageHandleCount, Is.EqualTo(2)); Assert.That(target.HandledMessageTypes.Contains(typeof(TestMessage))); Assert.That(target.HandledMessageTypes.Contains(typeof(DerivedTestMessage))); }
public void MessagesAreHandledInPolymorphicFashion() { var bus = new DirectDispatchMessageBus(); var target = new PolySubscriber(); bus.Subscribe(target); bus.Publish<DerivedTestMessage>(); Assert.That(target.MessageHandleCount, Is.EqualTo(2)); Assert.That(target.HandledMessageTypes.Contains(typeof(TestMessage))); Assert.That(target.HandledMessageTypes.Contains(typeof(DerivedTestMessage))); }