protected override Consumes <Message> GivenConsumer() { var dispatcher = new ByTypeDispatcher <Message>(); correctSubscriber = new TestConsumer <TestMessage>(); incorrectSubscriber = new TestConsumer <OtherMessage>(); baseClassSubscriber = new TestConsumer <BaseMessage>(); dispatcher.Subscribe(correctSubscriber); dispatcher.Subscribe(incorrectSubscriber); dispatcher.Subscribe(baseClassSubscriber); return(dispatcher); }
public void SubscribeTo <TDerived>(Consumes <TDerived> consumer) where TDerived : TBase { _dispatcher.Subscribe(consumer); }