Пример #1
0
        public void WithProducer()
        {
            var serviceCollection = new ServiceCollection();
            var producer          = new FakeProducer();

            serviceCollection
            .AddBrighter()
            .UseInMemoryOutbox()
            .UseExternalBus(producer, false)
            .AutoFromAssemblies();

            var serviceProvider = serviceCollection.BuildServiceProvider();

            var commandProcessor = serviceProvider.GetService <IAmACommandProcessor>();

            Assert.NotNull(commandProcessor);
        }
Пример #2
0
        public void WithProducer()
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection
            .AddBrighter(options =>
            {
                var outBox   = new InMemoryOutbox();
                var producer = new FakeProducer();
                options.BrighterMessaging = new BrighterMessaging(outBox, producer);
            })
            .AutoFromAssemblies();

            var serviceProvider = serviceCollection.BuildServiceProvider();

            var commandProcessor = serviceProvider.GetService <IAmACommandProcessor>();

            Assert.NotNull(commandProcessor);
        }