예제 #1
0
        public void Bootstrap_throws_when_two_handlers_for_same_command_registered()
        {
            // given
            var builder = new BusRegistryBuilder(typeof(InvalidCommandHandler1), typeof(InvalidCommandHandler2));

            // when/then
            Assert.Throws <InvalidOperationException>(() => builder.Bootstrap());
        }
예제 #2
0
        public void Bootstrap_throws_when_query_handler_returns_task_of_wrong_type()
        {
            // given
            var builder = new BusRegistryBuilder(typeof(InvalidQueryHandler1));

            // when/then
            Assert.Throws <Exception>(() => builder.Bootstrap());
        }
예제 #3
0
        public void Bootstrap_throws_when_multi_event_handler_has_wrong_type_as_an_argument()
        {
            // given
            var builder = new BusRegistryBuilder(typeof(InvalidMultiEventHandler));

            // when/then
            Assert.Throws <Exception>(() => builder.Bootstrap());
        }
예제 #4
0
        public void Bootstrap_throws_when_query_handler_has_not_generic_task_as_return_type()
        {
            // given
            var builder = new BusRegistryBuilder(typeof(InvalidQueryHandler2));

            // when/then
            Assert.Throws <Exception>(() => builder.Bootstrap());
        }
예제 #5
0
        public void Bootstrap_throws_when_command_handler_has_wrong_return_type()
        {
            // given
            var builder = new BusRegistryBuilder(typeof(InvalidCommandHandler3));

            // when/then
            Assert.Throws <Exception>(() => builder.Bootstrap());
        }