public JsonPostgresDummyPersistenceTest() { postgresUri = Environment.GetEnvironmentVariable("POSTGRES_URI"); postgresHost = Environment.GetEnvironmentVariable("POSTGRES_HOST") ?? "localhost"; postgresPort = Environment.GetEnvironmentVariable("POSTGRES_PORT") ?? "5432"; postgresDatabase = Environment.GetEnvironmentVariable("POSTGRES_DB") ?? "test"; postgresUsername = Environment.GetEnvironmentVariable("POSTGRES_USERNAME") ?? "postgres"; postgresPassword = Environment.GetEnvironmentVariable("POSTGRES_PASSWORD") ?? "postgres"; if (postgresUri == null && postgresHost == null) { return; } var dbConfig = ConfigParams.FromTuples( "connection.uri", postgresUri, "connection.host", postgresHost, "connection.port", postgresPort, "connection.database", postgresDatabase, "credential.username", postgresUsername, "credential.password", postgresPassword ); persistence = new JsonPostgresDummyPersistence(); persistence.Configure(dbConfig); fixture = new DummyPersistenceFixture(persistence); persistence.OpenAsync(null).Wait(); persistence.ClearAsync(null).Wait(); }
public JsonSqlServerDummyPersistenceTest() { sqlserverUri = Environment.GetEnvironmentVariable("SQLSERVER_URI"); sqlserverHost = Environment.GetEnvironmentVariable("SQLSERVER_SERVICE_HOST") ?? "localhost"; sqlserverPort = Environment.GetEnvironmentVariable("SQLSERVER_SERVICE_PORT") ?? "1433"; sqlserverDatabase = Environment.GetEnvironmentVariable("SQLSERVER_DB") ?? "master"; sqlserverUsername = Environment.GetEnvironmentVariable("SQLSERVER_USER") ?? "sa"; sqlserverPassword = Environment.GetEnvironmentVariable("SQLSERVER_PASS") ?? "sqlserver_123"; if (sqlserverUri == null && sqlserverHost == null) { return; } var dbConfig = ConfigParams.FromTuples( "connection.uri", sqlserverUri, "connection.host", sqlserverHost, "connection.port", sqlserverPort, "connection.database", sqlserverDatabase, "credential.username", sqlserverUsername, "credential.password", sqlserverPassword ); persistence = new JsonSqlServerDummyPersistence(); persistence.Configure(dbConfig); fixture = new DummyPersistenceFixture(persistence); persistence.OpenAsync(null).Wait(); persistence.ClearAsync(null).Wait(); }