diff --git a/src/MccSoft.IntegreSql.EF/IntegreSqlClient.cs b/src/MccSoft.IntegreSql.EF/IntegreSqlClient.cs index 346f81e..48634a3 100644 --- a/src/MccSoft.IntegreSql.EF/IntegreSqlClient.cs +++ b/src/MccSoft.IntegreSql.EF/IntegreSqlClient.cs @@ -181,7 +181,7 @@ public async Task GetTestDatabase(string hash) /// Returns test database to a pool (which allows consequent tests to reuse this database). /// This method (contrary to ) will tell IntegreSQL to cleanup the database. /// - public async Task ReleaseTestDatabase(string hash, int id) + public async Task RecreateTestDatabase(string hash, int id) { HttpResponseMessage response; try @@ -218,7 +218,7 @@ public async Task ReleaseTestDatabase(string hash, int id) /// If you don't want to clean it up, just don't use this function. /// Dirty databases are automatically deleted by IntegreSQL once database number exceeds a certain limit (500 by default). /// - /// Consider using if you want the DB to be deleted/recreated by IntegreSQL + /// Consider using if you want the DB to be deleted/recreated by IntegreSQL /// public async Task ReturnTestDatabase(string hash, int id) { diff --git a/src/MccSoft.IntegreSql.EF/MccSoft.IntegreSql.EF.csproj b/src/MccSoft.IntegreSql.EF/MccSoft.IntegreSql.EF.csproj index d712bd7..69cc206 100644 --- a/src/MccSoft.IntegreSql.EF/MccSoft.IntegreSql.EF.csproj +++ b/src/MccSoft.IntegreSql.EF/MccSoft.IntegreSql.EF.csproj @@ -1,7 +1,7 @@  - 0.10.2 + 0.10.3 true MCC Soft OpenIddict extension to support Auth code flow fo built-in ASP.Net identity providers diff --git a/src/MccSoft.IntegreSql.EF/NpgsqlDatabaseInitializer.cs b/src/MccSoft.IntegreSql.EF/NpgsqlDatabaseInitializer.cs index 8bb0655..6a265be 100644 --- a/src/MccSoft.IntegreSql.EF/NpgsqlDatabaseInitializer.cs +++ b/src/MccSoft.IntegreSql.EF/NpgsqlDatabaseInitializer.cs @@ -192,7 +192,7 @@ public override async Task RemoveDatabase(string connectionString) { var connectionStringInfo = ConnectionStringInfos[connectionString]; - await _integreSqlClient.ReleaseTestDatabase( + await _integreSqlClient.RecreateTestDatabase( connectionStringInfo.Hash, connectionStringInfo.Id ); @@ -220,9 +220,6 @@ protected override void PerformBasicSeedingOperations(DbContext dbContext) private string GetConnectionString(Config databaseConfig, string hash, int id) { - if (UseMd5Hash) - hash = Md5Hasher.CreateMD5(hash); - var builder = new NpgsqlConnectionStringBuilder() { Host = ConnectionStringOverride?.Host ?? databaseConfig.Host, diff --git a/tests/ExampleWeb.UnitTests/UnitTestSimplified.cs b/tests/ExampleWeb.UnitTests/UnitTestSimplified.cs index 2a0f262..35329db 100644 --- a/tests/ExampleWeb.UnitTests/UnitTestSimplified.cs +++ b/tests/ExampleWeb.UnitTests/UnitTestSimplified.cs @@ -17,7 +17,10 @@ public UnitTestSimplified() // This is needed if you run tests NOT inside the container. // 5434 is the public port number of Postgresql instance connectionStringOverride: new() { Host = "localhost", Port = 5434, } - ); + ) + { + DropDatabaseOnRemove = true, + }; _dbContextOptions = _databaseInitializer .CreateDatabaseGetDbContextOptionsBuilderSync() .Options; @@ -31,6 +34,7 @@ public ExampleDbContext CreateDbContext() [Fact] public async Task Test1() { + var connectionString = CreateDbContext().Database.GetConnectionString(); var service = new UserService(CreateDbContext()); var users = await service.GetUsers(); Assert.Equal(new[] { "John", "Bill" }, users);