Пример #1
0
        public void when_can_handle_requested_for_registered_handler_instance_then_returns_true()
        {
            var bus = new CommandBusComponent(Mock.Of <IComponentModel>(x =>
                                                                        x.GetExtensions <ICanExecute <Command> >() == new[] { Mock.Of <ICanExecute <Command> >() }));

            Assert.True(bus.CanHandle(new Command()));
        }
Пример #2
0
        public void when_can_handle_requested_for_null_command_then_throws()
        {
            var bus = new CommandBusComponent(Mock.Of <IComponentModel>());

            Assert.Throws <ArgumentNullException> (() => bus.CanHandle((Command)null));
        }
Пример #3
0
        public void when_can_handle_requested_for_non_registered_handler_then_returns_false()
        {
            var bus = new CommandBusComponent(Mock.Of <IComponentModel>());

            Assert.False(bus.CanHandle <Command> ());
        }