Exemplo n.º 1
0
        public void OneTimeSetUp()
        {
            _msSqlDatabase = MsSqlHelpz.CreateDatabase("hangfire");

            var sqlServerStorageOptions = new SqlServerStorageOptions
            {
                QueuePollInterval = TimeSpan.FromSeconds(1),
            };

            _log = new HangfireJobLog();

            var jobFilterCollection = new JobFilterCollection {
                _log
            };

            var backgroundJobServerOptions = new BackgroundJobServerOptions
            {
                SchedulePollingInterval = TimeSpan.FromSeconds(1),
                FilterProvider          = jobFilterCollection
            };

            GlobalConfiguration.Configuration
            .UseSqlServerStorage(_msSqlDatabase.ConnectionString.Value, sqlServerStorageOptions)
            .UseActivator(new DelegatingActivator(() => _eventFlowResolverActivator));

            _backgroundJobServer = new BackgroundJobServer(backgroundJobServerOptions);
        }
Exemplo n.º 2
0
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = MsSqlHelpz.CreateDatabase("eventflow");

            return(eventFlowOptions
                   .RegisterServices(sr => sr.Register(c => _testDatabase.ConnectionString))
                   .ConfigureEntityFramework(EntityFrameworkConfiguration.New)
                   .AddDbContextProvider <TestDbContext, MsSqlDbContextProvider>()
                   .ConfigureForEventStoreTest()
                   .CreateResolver());
        }
Exemplo n.º 3
0
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = MsSqlHelpz.CreateDatabase("eventflow-snapshots");

            var resolver = eventFlowOptions
                           .ConfigureMsSql(MsSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
                           .UseMsSqlSnapshotStore()
                           .CreateResolver();

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

            EventFlowSnapshotStoresMsSql.MigrateDatabase(databaseMigrator);

            return(resolver);
        }
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = MsSqlHelpz.CreateDatabase("eventflow");

            var resolver = eventFlowOptions
                           .ConfigureMsSql(MsSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
                           .UseEventStore <MsSqlEventPersistence>()
                           .CreateResolver();

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

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

            return(resolver);
        }
Exemplo n.º 5
0
        public void OneTimeSetUp()
        {
            _msSqlDatabase = MsSqlHelpz.CreateDatabase("hangfire");

            var sqlServerStorageOptions = new SqlServerStorageOptions
            {
                QueuePollInterval = TimeSpan.FromSeconds(1),
            };
            var backgroundJobServerOptions = new BackgroundJobServerOptions
            {
                SchedulePollingInterval = TimeSpan.FromSeconds(1),
            };

            GlobalConfiguration.Configuration
            .UseSqlServerStorage(_msSqlDatabase.ConnectionString.Value, sqlServerStorageOptions)
            .UseActivator(new DelegatingActivator(() => _eventFlowResolverActivator));

            _webApp = WebApp.Start("http://127.0.0.1:9001", app => app.UseHangfireDashboard());
            _backgroundJobServer = new BackgroundJobServer(backgroundJobServerOptions);
        }
        public override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            TestDatabase = MsSqlHelpz.CreateDatabase("eventflow");

            var resolver = eventFlowOptions
                           .ConfigureMsSql(MsSqlConfiguration.New.SetConnectionString(TestDatabase.ConnectionString.Value))
                           .UseEventStore <MsSqlEventPersistence>()
                           .UseMssqlReadModel <MsSqlTestAggregateReadModel>()
                           .CreateResolver();

            MsSqlConnection       = resolver.Resolve <IMsSqlConnection>();
            ReadModelSqlGenerator = resolver.Resolve <IReadModelSqlGenerator>();
            ReadModelPopulator    = resolver.Resolve <IReadModelPopulator>();

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

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

            return(resolver);
        }
Exemplo n.º 7
0
        protected override IRootResolver CreateRootResolver(IEventFlowOptions eventFlowOptions)
        {
            _testDatabase = MsSqlHelpz.CreateDatabase("eventflow");

            var resolver = eventFlowOptions
                           .RegisterServices(sr => sr.RegisterType(typeof(ThingyMessageLocator)))
                           .ConfigureMsSql(MsSqlConfiguration.New.SetConnectionString(_testDatabase.ConnectionString.Value))
                           .UseMssqlReadModel <MsSqlThingyReadModel>()
                           .UseMssqlReadModel <MsSqlThingyMessageReadModel, ThingyMessageLocator>()
                           .AddQueryHandlers(
                typeof(MsSqlThingyGetQueryHandler),
                typeof(MsSqlThingyGetVersionQueryHandler),
                typeof(MsSqlThingyGetMessagesQueryHandler))
                           .CreateResolver();

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

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

            return(resolver);
        }
Exemplo n.º 8
0
 public void SetUp()
 {
     _msSqlDatabase = MsSqlHelpz.CreateDatabase("eventflow");
 }
 public void SetUp()
 {
     _testDatabase = MsSqlHelpz.CreateDatabase("index_fragmentation");
     _testDatabase.Execute("CREATE TABLE IndexFragmentationString (Id nvarchar(250) PRIMARY KEY)");
     _testDatabase.Execute("CREATE TABLE IndexFragmentationGuid (Id uniqueidentifier PRIMARY KEY)");
 }
Exemplo n.º 10
0
 public void SetUp()
 {
     _sut = MsSqlHelpz.CreateDatabase("mssql");
 }
Exemplo n.º 11
0
 public void SetUp()
 {
     _msSqlDatabase = MsSqlHelpz.CreateDatabase("hangfire");
 }