예제 #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> ());
        }