Пример #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());
        }