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"); }
public string TryHandle(OtherTestQuery dispatchable) { return("42"); }