public void everything_is_registered_properly()
        {
            var c         = ServiceBus.ConfigureAsMemoryBus(_sut, GetType().GetTypeInfo().Assembly);
            var container = _cb.Build();

            c.Build(new AutofacContainer(container));

            container.Resolve <Handler>().Should().NotBeNull();
            container.Resolve <IDomainBus>().Should().NotBeNull();
            container.Resolve <IDispatchMessages>().Should().NotBeNull();
        }
Exemplo n.º 2
0
        public void using_memory_bus()
        {
            ServiceBus.ConfigureAsMemoryBus(TestContainerBuilder.Instance, typeof(SomeHandler));
            var bus     = ServiceBus.Build(ActivatorContainer.Instance);
            var sut     = bus.GetDispatcher();
            var command = new MyCommand();

            sut.Send(command);
            bus.GetProcessingQueue(ServiceBus.MemoryProcessor).WaitUntilWorkersFinish();
            _results.Contains(typeof(MyCommand)).Should().BeTrue();
            sut.Publish(new MyEvent().EnrolInOperation(command));
            bus.GetProcessingQueue(ServiceBus.MemoryProcessor).WaitUntilWorkersFinish();
            _results.Contains(typeof(MyEvent)).Should().BeTrue();
        }
 public Integration_with_container()
 {
     _sut = ServiceBus.ConfigureAsMemoryBus(_container, typeof(MyHandler));
 }