public SqlServerTestDatabase(TestDatabaseSettings settings, ILoggerFactory loggerFactory, IUmbracoDatabaseFactory databaseFactory) { _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory)); _databaseFactory = databaseFactory ?? throw new ArgumentNullException(nameof(databaseFactory)); _settings = settings; var counter = 0; var schema = Enumerable.Range(0, _settings.SchemaDatabaseCount) .Select(x => TestDbMeta.CreateWithMasterConnectionString($"{DatabaseName}-{++counter}", false, _settings.SQLServerMasterConnectionString)); var empty = Enumerable.Range(0, _settings.EmptyDatabasesCount) .Select(x => TestDbMeta.CreateWithMasterConnectionString($"{DatabaseName}-{++counter}", true, _settings.SQLServerMasterConnectionString)); _testDatabases = schema.Concat(empty).ToList(); }
public SqlDeveloperTestDatabase(TestDatabaseSettings settings, ILoggerFactory loggerFactory, IUmbracoDatabaseFactory databaseFactory, string masterConnectionString) { _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory)); _databaseFactory = databaseFactory ?? throw new ArgumentNullException(nameof(databaseFactory)); _settings = settings; _masterConnectionString = masterConnectionString; var counter = 0; var schema = Enumerable.Range(0, _settings.SchemaDatabaseCount) .Select(x => TestDbMeta.CreateWithMasterConnectionString($"{DatabaseName}-{++counter}", false, masterConnectionString)); var empty = Enumerable.Range(0, _settings.EmptyDatabasesCount) .Select(x => TestDbMeta.CreateWithMasterConnectionString($"{DatabaseName}-{++counter}", true, masterConnectionString)); _testDatabases = schema.Concat(empty).ToList(); Instance = this; // For GlobalSetupTeardown.cs }