protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = PostgreSqlHelpz.CreateDatabase("eventflow-snapshots");

            return(eventFlowOptions
                   .RegisterServices(sr => sr.Register(c => _testDatabase.ConnectionString))
                   .ConfigureEntityFramework(EntityFrameworkConfiguration.New)
                   .AddDbContextProvider <TestDbContext, PostgreSqlDbContextProvider>()
                   .ConfigureForSnapshotStoreTest()
                   .CreateResolver());
        }
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = PostgreSqlHelpz.CreateDatabase("eventflow-snapshots");

            var resolver = eventFlowOptions
                           .ConfigurePostgreSql(PostgreSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
                           .UsePostgreSqlSnapshotStore()
                           .CreateResolver();

            var databaseMigrator = resolver.Resolve <IPostgreSqlDatabaseMigrator>();

            EventFlowSnapshotStoresPostgreSql.MigrateDatabase(databaseMigrator);

            return(resolver);
        }
Exemple #3
0
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = PostgreSqlHelpz.CreateDatabase("eventflow");

            var resolver = eventFlowOptions
                           .ConfigurePostgreSql(PostgreSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
                           .UseEventStore <PostgreSqlEventPersistence>()
                           .CreateResolver();

            var databaseMigrator = resolver.Resolve <IPostgreSqlDatabaseMigrator>();

            EventFlowEventStoresPostgreSql.MigrateDatabase(databaseMigrator);
            databaseMigrator.MigrateDatabaseUsingEmbeddedScripts(GetType().Assembly);

            return(resolver);
        }
Exemple #4
0
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = PostgreSqlHelpz.CreateDatabase("eventflow");

            var resolver = eventFlowOptions
                           .RegisterServices(sr => sr.RegisterType(typeof(ThingyMessageLocator)))
                           .ConfigurePostgreSql(PostgreSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
                           .UsePostgreSqlReadModel <PostgreSqlThingyReadModel>()
                           .UsePostgreSqlReadModel <PostgreSqlThingyMessageReadModel, ThingyMessageLocator>()
                           .AddQueryHandlers(
                typeof(PostgreSqlThingyGetQueryHandler),
                typeof(PostgreSqlThingyGetVersionQueryHandler),
                typeof(PostgreSqlThingyGetMessagesQueryHandler))
                           .CreateResolver();

            var databaseMigrator = resolver.Resolve <IPostgreSqlDatabaseMigrator>();

            EventFlowEventStoresPostgreSql.MigrateDatabase(databaseMigrator);
            databaseMigrator.MigrateDatabaseUsingEmbeddedScripts(GetType().Assembly);

            return(resolver);
        }
Exemple #5
0
 public void SetUp()
 {
     _postgreSqlDatabase = PostgreSqlHelpz.CreateDatabase("eventflow");
 }