예제 #1
0
        public void Dispatch_Should_Call_TryHandle_On_Corresponding_Handler_Interface()
        {
            MultiInterfaceHandler fakeHandler      = new MultiInterfaceHandler();
            IDispatcher <IQuery>  DispatcherTested = new Dispatcher <IQuery>(fakeHandler);
            TestQuery             testQuery        = new TestQuery();
            OtherTestQuery        otherTestQuery   = new OtherTestQuery();

            DispatcherTested.Dispatch <int>(testQuery).Should().Be(42);
            DispatcherTested.Dispatch <string>(otherTestQuery).Should().Be("42");
        }
예제 #2
0
 public string TryHandle(OtherTestQuery dispatchable)
 {
     return("42");
 }