Index: Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs =================================================================== diff -u -r1b9445050ddc7786014349d7014c7c4d85242a5d -r82b2158c3ba292b313a3607c654881dde20fe6d0 --- Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs (.../RingtoetsProjectMigratorTest.cs) (revision 1b9445050ddc7786014349d7014c7c4d85242a5d) +++ Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs (.../RingtoetsProjectMigratorTest.cs) (revision 82b2158c3ba292b313a3607c654881dde20fe6d0) @@ -388,23 +388,20 @@ var migrator = new RingtoetsProjectMigrator(inquiryHelper); - using (new FileDisposeHelper(targetFilePath)) - { - bool migrationSuccessful = false; + bool migrationSuccessful = false; - // When - Action call = () => migrationSuccessful = migrator.Migrate(sourceFilePath, targetFilePath); + // When + Action call = () => migrationSuccessful = migrator.Migrate(sourceFilePath, targetFilePath); - // Then - string expectedMessage = $"Het projectbestand '{sourceFilePath}' is succesvol gemigreerd naar '{targetFilePath}' (versie {currentDatabaseVersion})."; - Tuple expectedLogMessageAndLevel = Tuple.Create(expectedMessage, LogLevelConstant.Info); - TestHelper.AssertLogMessageWithLevelIsGenerated(call, expectedLogMessageAndLevel, 1); + // Then + string expectedMessage = $"Het projectbestand '{sourceFilePath}' is succesvol gemigreerd naar '{targetFilePath}' (versie {currentDatabaseVersion})."; + Tuple expectedLogMessageAndLevel = Tuple.Create(expectedMessage, LogLevelConstant.Info); + TestHelper.AssertLogMessageWithLevelIsGenerated(call, expectedLogMessageAndLevel, 1); - Assert.IsTrue(migrationSuccessful); + Assert.IsTrue(migrationSuccessful); - var toVersionedFile = new RingtoetsVersionedFile(targetFilePath); - Assert.AreEqual(currentDatabaseVersion, toVersionedFile.GetVersion()); - } + var toVersionedFile = new RingtoetsVersionedFile(targetFilePath); + Assert.AreEqual(currentDatabaseVersion, toVersionedFile.GetVersion()); mocks.VerifyAll(); } @@ -462,22 +459,19 @@ var migrator = new RingtoetsProjectMigrator(inquiryHelper); - using (new FileDisposeHelper(targetFilePath)) - { - bool migrationSuccessful = true; + bool migrationSuccessful = true; - // Call - Action call = () => migrationSuccessful = migrator.Migrate(sourceFilePath, targetFilePath); + // Call + Action call = () => migrationSuccessful = migrator.Migrate(sourceFilePath, targetFilePath); - // Assert - TestHelper.AssertLogMessages(call, messages => - { - string[] msgs = messages.ToArray(); - Assert.AreEqual(1, msgs.Length); - StringAssert.StartsWith($"Het migreren van het projectbestand '{sourceFilePath}' is mislukt: ", msgs[0]); - }); - Assert.IsFalse(migrationSuccessful); - } + // Assert + TestHelper.AssertLogMessages(call, messages => + { + string[] msgs = messages.ToArray(); + Assert.AreEqual(1, msgs.Length); + StringAssert.StartsWith($"Het migreren van het projectbestand '{sourceFilePath}' is mislukt: ", msgs[0]); + }); + Assert.IsFalse(migrationSuccessful); mocks.VerifyAll(); }