Index: Application/Ringtoets/test/Application.Ringtoets.Migration.Core.Test/RingtoetsUpgradeScriptTest.cs =================================================================== diff -u -r9d68a734d8da9bfadd3bdd349ddb56fb70d461ec -r28ab332db2d96ad9e766f19677af1c00fc88a644 --- Application/Ringtoets/test/Application.Ringtoets.Migration.Core.Test/RingtoetsUpgradeScriptTest.cs (.../RingtoetsUpgradeScriptTest.cs) (revision 9d68a734d8da9bfadd3bdd349ddb56fb70d461ec) +++ Application/Ringtoets/test/Application.Ringtoets.Migration.Core.Test/RingtoetsUpgradeScriptTest.cs (.../RingtoetsUpgradeScriptTest.cs) (revision 28ab332db2d96ad9e766f19677af1c00fc88a644) @@ -141,24 +141,27 @@ string fromVersion = RingtoetsVersionHelper.GetCurrentDatabaseVersion(); string toVersion = RingtoetsVersionHelper.GetCurrentDatabaseVersion(); + string fileLocation = TestHelper.GetScratchPadPath(nameof(Upgrade_UpgradeFails_ThrowsCriticalMigrationException)); var upgradeScript = new RingtoetsUpgradeScript(fromVersion, toVersion, "THIS WILL FAIL"); - // Call - TestDelegate call = () => upgradeScript.Upgrade("c:\\file.ext", "c:\\file.ext"); + using (new FileDisposeHelper(fileLocation)) + { + // Call + TestDelegate call = () => upgradeScript.Upgrade(fileLocation, fileLocation); - // Assert - CriticalMigrationException exception = Assert.Throws(call); - Assert.AreEqual($"Het migreren van het Ringtoets projectbestand van versie '{fromVersion}' naar '{fromVersion}' is mislukt.", - exception.Message); - Assert.IsInstanceOf(exception.InnerException); + // Assert + CriticalMigrationException exception = Assert.Throws(call); + Assert.AreEqual($"Het migreren van het Ringtoets projectbestand van versie '{fromVersion}' naar '{fromVersion}' is mislukt.", + exception.Message); + Assert.IsInstanceOf(exception.InnerException); + } } [Test] public void Upgrade_ValidParameters_ExpectedProperties() { // Setup - string filename = Path.GetRandomFileName(); - string filePath = TestHelper.GetScratchPadPath(filename); + string filePath = TestHelper.GetScratchPadPath(nameof(Upgrade_ValidParameters_ExpectedProperties)); string fromVersion = RingtoetsVersionHelper.GetCurrentDatabaseVersion(); string toVersion = RingtoetsVersionHelper.GetCurrentDatabaseVersion();