Index: Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs =================================================================== diff -u -r69eb17523e5ae490637e29718a4a563cbcaacc3c -r1b9445050ddc7786014349d7014c7c4d85242a5d --- Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs (.../RingtoetsProjectMigratorTest.cs) (revision 69eb17523e5ae490637e29718a4a563cbcaacc3c) +++ Application/Ringtoets/test/Application.Ringtoets.Migration.Test/RingtoetsProjectMigratorTest.cs (.../RingtoetsProjectMigratorTest.cs) (revision 1b9445050ddc7786014349d7014c7c4d85242a5d) @@ -37,8 +37,8 @@ [TestFixture] public class RingtoetsProjectMigratorTest { - private readonly string currentDatabaseVersion = RingtoetsVersionHelper.GetCurrentDatabaseVersion(); private const string testDirectory = nameof(RingtoetsProjectMigratorTest); + private readonly string currentDatabaseVersion = RingtoetsVersionHelper.GetCurrentDatabaseVersion(); private DirectoryDisposeHelper directoryDisposeHelper; [SetUp] @@ -136,15 +136,15 @@ string fileVersion = versionedFile.GetVersion(); var migrator = new RingtoetsProjectMigrator(inquiryHelper); - var shouldMigrate = MigrationNeeded.Yes; + var shouldMigrate = MigrationRequired.Yes; // Call Action call = () => shouldMigrate = migrator.ShouldMigrate(sourceFilePath); // Assert string expectedMessage = $"Het migreren van een projectbestand met versie '{fileVersion}' naar versie '{currentDatabaseVersion}' is niet ondersteund."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage); - Assert.AreEqual(MigrationNeeded.Aborted, shouldMigrate); + Assert.AreEqual(MigrationRequired.Aborted, shouldMigrate); mocks.VerifyAll(); } @@ -167,20 +167,21 @@ var migrator = new RingtoetsProjectMigrator(inquiryHelper); // Call - MigrationNeeded shouldMigrate = MigrationNeeded.No; + MigrationRequired shouldMigrate = MigrationRequired.No; Action call = () => shouldMigrate = migrator.ShouldMigrate(sourceFilePath); // Assert - var expectedLogMessages = new List(); + var expectedLogMessages = new List>(); if (!confirmContinuation) { - expectedLogMessages.Add($"Het migreren van het projectbestand '{sourceFilePath}' is geannuleerd."); + expectedLogMessages.Add(Tuple.Create($"Het migreren van het projectbestand '{sourceFilePath}' is geannuleerd.", + LogLevelConstant.Warn)); } - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, expectedLogMessages.Count); + TestHelper.AssertLogMessagesWithLevelAreGenerated(call, expectedLogMessages, expectedLogMessages.Count); var expectedResult = confirmContinuation ? - MigrationNeeded.Yes : - MigrationNeeded.Aborted; + MigrationRequired.Yes : + MigrationRequired.Aborted; Assert.AreEqual(expectedResult, shouldMigrate); mocks.VerifyAll(); @@ -199,10 +200,10 @@ var migrator = new RingtoetsProjectMigrator(inquiryHelper); // Call - MigrationNeeded shouldMigrate = migrator.ShouldMigrate(sourceFilePath); + MigrationRequired shouldMigrate = migrator.ShouldMigrate(sourceFilePath); // Assert - Assert.AreEqual(MigrationNeeded.No, shouldMigrate); + Assert.AreEqual(MigrationRequired.No, shouldMigrate); mocks.VerifyAll(); } @@ -257,9 +258,9 @@ string validFilePath = TestHelper.GetScratchPadPath($"{originalFileName}.{expectedFileExtension}"); - string versionWithUnderscores = RingtoetsVersionHelper.GetCurrentDatabaseVersion().Replace('.', '-'); + string versionWithDashes = RingtoetsVersionHelper.GetCurrentDatabaseVersion().Replace('.', '-'); var expectedFileFilter = new FileFilterGenerator(expectedFileExtension, "Ringtoets project"); - string expectedSuggestedFileName = $"{originalFileName}_{versionWithUnderscores}"; + string expectedSuggestedFileName = $"{originalFileName}_{versionWithDashes}"; string expectedReturnPath = TestHelper.GetScratchPadPath("Im_a_file_path_to_the_migrated_file.rtd");