Esempio n. 1
0
 public RelayerTests()
 {
     _bus = ServiceBus.ConfigureForMonolith(c =>
     {
         c.AutoConfigureFrom(new [] { typeof(Handler) })
         .RegisterTypesInContainer(new MemoryBusTests.TestContainerBuilder())
         .DefaultProcessors().RelayEventsLocally(cf => cf.Send(Relay));
     }).Build(new DependencyContainerWrapper(t => t.CreateInstance()));
 }
        public void extra_features_added_properly()
        {
            _cb.RegisterType <FakeappendStore>().As <IAppendEventsToStore>();
            var c = ServiceBus.ConfigureForMonolith(
                hc =>
            {
                hc.RegisterWithAutofac(_cb, a => a.WithCommandResultSupport().WithEventStorePublisherSupport())
                .RegisterHandlersAndSagaStatesFrom(GetType().GetTypeInfo().Assembly)
                .ConfigureProcessors(p => p.Add(ServiceBus.MemoryProcessor, s => s.HandlesEverything()));
            }
                );
            var container = _cb.Build();

            c.Build(new AutofacContainer(container));
            container.Resolve <ICommandResultMediator>().Should().NotBeNull();
            container.Resolve <IRequestCommandResult>().Should().NotBeNull();
            container.Resolve <IReturnCommandResult>().Should().NotBeNull();
            container.Resolve <IStoreAndPublishEvents>().Should().NotBeNull();
        }