Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public void SubscribeTo <TDerived>(Consumes <TDerived> consumer) where TDerived : TBase
 {
     _dispatcher.Subscribe(consumer);
 }