Ejemplo n.º 1
0
        public void when_can_execute_requested_then_invokes_sync_handler()
        {
            var command = new Command();
            var bus     = new CommandBusComponent(Mock.Of <IComponentModel>(x =>
                                                                            x.GetExtensions <ICanExecute <Command> >() == new[] { Mock.Of <ICanExecute <Command> >(c => c.CanExecute(command) == true) }));

            Assert.True(bus.CanExecute(command));
        }
Ejemplo n.º 2
0
        public void when_can_execute_requested_and_no_handler_registered_then_returns_false()
        {
            var bus = new CommandBusComponent(Mock.Of <IComponentModel>());

            Assert.False(bus.CanExecute(new Command()));
        }