public void FunctionFor0HandleresDoesNotDoAnythig() { var commanBus = new CommandBus(); commanBus.RegisterHandlers<FuncCommand>("nonExistentNamespaceWillHave 0 handlers"); commanBus.Publish(new FuncCommand()); }
public void FunctionCallsAHandlerAndReturns() { var commanBus = new CommandBus(); commanBus.RegisterHandlers<FuncCommand>("Commandos.Specs.Samples"); var command = new FuncCommand(); var result = commanBus.Publish<FuncCommand>((object) command); Assert.That(command, Is.SameAs(result)); }
public void ActionCallsVoidHandler() { var commanBus = new CommandBus(); commanBus.RegisterHandlers<FuncCommand>("Commandos.Specs.Samples"); var command = new ActionCommand(); commanBus.Publish(command); Assert.IsTrue(command.Called); }