@@ -4,33 +4,22 @@ namespace RepositoryTests;
44
55public class RepositoryTests
66{
7- private const string EnvFile = ".env" ;
8-
9- [ Test ]
10- public void TestMySqlEnvVarsConsistent ( )
11- {
12- Assert . That ( File . Exists ( EnvFile ) ) ;
13- DotEnv . Load ( options : new DotEnvOptions ( envFilePaths : [ EnvFile ] ) ) ;
14-
15- var testsDb = Environment . GetEnvironmentVariable ( "TESTS_DB" ) ;
16- var mysqlConnectionString = Environment . GetEnvironmentVariable ( "MYSQL_CONNECTION_STRING" ) ;
17- Assert . That ( mysqlConnectionString , Is . Not . Null ) ;
18- var mysqlConnParts = mysqlConnectionString . Split ( ';' ) ;
19- Assert . That ( mysqlConnParts , Does . Contain ( $ "database={ testsDb } ") ) ;
20- }
21-
227 [ Test ]
23- public void TestPostgresEnvVarsConsistent ( )
8+ [ TestCase ( ".env" ) ]
9+ [ TestCase ( ".benchmark.env" ) ]
10+ public void TestPostgresEnvVarsConsistent ( string envFile )
2411 {
25- Assert . That ( File . Exists ( EnvFile ) ) ;
26- DotEnv . Load ( options : new DotEnvOptions ( envFilePaths : [ EnvFile ] ) ) ;
12+ Assert . That ( File . Exists ( envFile ) ) ;
13+ DotEnv . Load ( options : new DotEnvOptions ( envFilePaths : [ envFile ] ) ) ;
2714
2815 var testsDb = Environment . GetEnvironmentVariable ( "TESTS_DB" ) ;
2916 var postgresUser = Environment . GetEnvironmentVariable ( "POSTGRES_USER" ) ;
3017 var postgresPassword = Environment . GetEnvironmentVariable ( "POSTGRES_PASSWORD" ) ;
3118 var postgresConnectionString = Environment . GetEnvironmentVariable ( "POSTGRES_CONNECTION_STRING" ) ;
19+
3220 Assert . That ( postgresConnectionString , Is . Not . Null ) ;
3321 var postgresConnParts = postgresConnectionString . Split ( ';' ) ;
22+
3423 Assert . That ( postgresConnParts , Does . Contain ( $ "database={ testsDb } ") ) ;
3524 Assert . That ( postgresConnParts , Does . Contain ( $ "username={ postgresUser } ") ) ;
3625 Assert . That ( postgresConnParts , Does . Contain ( $ "password={ postgresPassword } ") ) ;
0 commit comments