Exemplo n.º 1
0
        public void RegisterWorks()
        {
            var factory = new DryIocContainerAdapterFactory();

            factory.RegisterHandlerType <SomeHandler>();
            factory.RegisterHandlerType <AnotherHandler>();

            using (var context = new DefaultTransactionContext())
            {
                const string stringMessage = "bimse";

                var handlers = factory.GetActivator().GetHandlers(stringMessage, context).Result.ToList();

                Assert.That(handlers.Count, Is.EqualTo(2));
            }
        }
Exemplo n.º 2
0
        public void RegisterWorks()
        {
            var factory   = new DryIocContainerAdapterFactory();
            var activator = factory.CreateContainerAdapter(r =>
            {
                r.Register <SomeHandler>();
                r.Register <AnotherHandler>();
            });

            using (var scope = new RebusTransactionScope())
            {
                const string stringMessage = "bimse";

                var handlers = activator.GetHandlers(stringMessage, scope.TransactionContext).Result.ToList();

                Assert.That(handlers.Count, Is.EqualTo(2));
            }
        }