예제 #1
0
        public void FunctionFor0HandleresDoesNotDoAnythig()
        {
            var commanBus = new CommandBus();
            commanBus.RegisterHandlers<FuncCommand>("nonExistentNamespaceWillHave 0 handlers");

            commanBus.Publish(new FuncCommand());
        }
예제 #2
0
        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));
        }
예제 #3
0
        public void ActionCallsVoidHandler()
        {
            var commanBus = new CommandBus();
            commanBus.RegisterHandlers<FuncCommand>("Commandos.Specs.Samples");

            var command = new ActionCommand();

            commanBus.Publish(command);

            Assert.IsTrue(command.Called);
        }