Ejemplo n.º 1
0
        public void FunctionFor0HandleresDoesNotDoAnythig()
        {
            var commanBus = new CommandBus();
            commanBus.RegisterHandlers<FuncCommand>("nonExistentNamespaceWillHave 0 handlers");

            commanBus.Publish(new FuncCommand());
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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);
        }