public TestBase() { var services = new ServiceCollection(); var configuration = ConfigurationRootCreatorForTesting.Create(services); var elasticsearchUrl = configuration["ElasticsearchUrl"]; var connection = new ConnectionSettings(new Uri(elasticsearchUrl)); connection.DisableDirectStreaming(true); Resolver = EventFlowOptions.New .UseServiceCollection(services) .RegisterModule <FlightAvailabilityDomainModule>() .RegisterModule <CommandModule>() .RegisterModule <CommandHandlersModule>() .RegisterModule <ElasticsearchReadModelModule>() .RegisterModule <ElasticsearchQueryHandlersModule>() .ConfigureElasticsearch(connection) .CreateResolver(); CommandBus = Resolver.Resolve <ICommandBus>(); QueryProcessor = Resolver.Resolve <IQueryProcessor>(); var indexer = Resolver.Resolve <FlightAvailabilityReadModelIndexer>(); indexer.PrepareIndex(); }
public TestBase() { var services = new ServiceCollection(); ConfigurationRootCreatorForTesting.Create(services); FlightAvailabilityId = FlightAvailabilityId.New; Resolver = EventFlowOptions.New .UseServiceCollection(services) .RegisterModule <FlightAvailabilityDomainModule>() .RegisterServices(r => r.Register <IDbContextProvider <EventStoreContext>, FakedEventStoreContextProvider>()) .CreateResolver(); AggregateStore = Resolver.Resolve <IAggregateStore>(); }