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