private TestServer TestServerFactory(ITransaction transaction, ICompositeStores compositeStores, EventsMetadataService eventsMetadataService = null)
        {
            var builder = new WebHostBuilder()
                          .UseStartup <Startup>()
                          .ConfigureServices(services => {
                services.AddScoped <IEventsMetadataService>(e => eventsMetadataService);
                services.AddScoped <ITransaction>(provider => transaction);
                services.AddScoped <IEventStore>(provider => compositeStores.EventStore);
                services.AddScoped <ISnapshotStore>(provider => compositeStores.SnapshotStore);
                services.AddScoped <IMetadataProvider, FakeUserMetadataProvider>();
            });

            var testServer = new TestServer(builder);

            return(testServer);
        }
Example #2
0
 public static ISession Create(
     ITransaction transaction,
     ICompositeStores stores,
     ILoggerFactory loggerFactory                      = null,
     IEventPublisher eventPublisher                    = null,
     IEventRouter eventRouter                          = null,
     IEventUpdateManager eventUpdateManager            = null,
     IEnumerable <IMetadataProvider> metadataProviders = null,
     ISnapshotStrategy snapshotStrategy                = null,
     IEventsMetadataService eventsMetadataService      = null)
 {
     return(Create(transaction,
                   stores.EventStore,
                   stores.SnapshotStore,
                   loggerFactory,
                   eventPublisher,
                   eventRouter,
                   eventUpdateManager,
                   metadataProviders,
                   snapshotStrategy,
                   eventsMetadataService));
 }
Example #3
0
 public EventStoreTestSuit(ITransaction transaction, ICompositeStores stores)
 {
     _stores = new StoresWrapper(transaction, stores.EventStore, stores.SnapshotStore);
 }