Index: Migration/Core/test/Migration.Core.Storage.Test/VersionedFileMigratorTest.cs =================================================================== diff -u -r747809ca347ed4c7762c31b2bd643eac4d22b02d -r7928b904836d7bd27bb70552ca115182a8a29047 --- Migration/Core/test/Migration.Core.Storage.Test/VersionedFileMigratorTest.cs (.../VersionedFileMigratorTest.cs) (revision 747809ca347ed4c7762c31b2bd643eac4d22b02d) +++ Migration/Core/test/Migration.Core.Storage.Test/VersionedFileMigratorTest.cs (.../VersionedFileMigratorTest.cs) (revision 7928b904836d7bd27bb70552ca115182a8a29047) @@ -104,25 +104,25 @@ public void Migrate_ValidFiles_SavesFileAtNewLocation() { // Setup + const string newVersion = "17.1"; string sourceFilePath = TestHelper.GetTestDataPath(TestDataPath.Migration.Core.Storage, "Demo164.rtd"); var fromVersionedFile = new VersionedFile(sourceFilePath); string targetFilePath = TestHelper.GetTestDataPath(TestDataPath.Migration.Core.Storage, Path.GetRandomFileName()); - var migrator = new VersionedFileMigrator(); // Call - migrator.Migrate(fromVersionedFile, "17.1", targetFilePath); + migrator.Migrate(fromVersionedFile, newVersion, targetFilePath); // Assert - if (File.Exists(targetFilePath)) + if (!File.Exists(targetFilePath)) { - using (new FileDisposeHelper(targetFilePath)) {} - } - else - { Assert.Fail($"File was not created at location '{targetFilePath}'"); } + + var toVersionedFile = new VersionedFile(targetFilePath); + Assert.AreEqual(newVersion, toVersionedFile.GetVersion()); + using (new FileDisposeHelper(targetFilePath)) {} } } } \ No newline at end of file Index: Migration/Scripts/src/Migration.Scripts.Data/Resources/Migration_4_17.1.sql =================================================================== diff -u -r747809ca347ed4c7762c31b2bd643eac4d22b02d -r7928b904836d7bd27bb70552ca115182a8a29047 --- Migration/Scripts/src/Migration.Scripts.Data/Resources/Migration_4_17.1.sql (.../Migration_4_17.1.sql) (revision 747809ca347ed4c7762c31b2bd643eac4d22b02d) +++ Migration/Scripts/src/Migration.Scripts.Data/Resources/Migration_4_17.1.sql (.../Migration_4_17.1.sql) (revision 7928b904836d7bd27bb70552ca115182a8a29047) @@ -1 +1,48 @@ -INSERT INTO VersionEntity Values(1, "17.1", '2017-01-18 08:08:10.8393231', "a"); \ No newline at end of file +ATTACH DATABASE [{0}] AS SOURCEPROJECT; + +INSERT INTO VersionEntity ( + [VersionId], + [Version], + [Timestamp], + [FingerPrint]) +SELECT + [VersionId], + "17.1", + [Timestamp], + [FingerPrint] +FROM [SOURCEPROJECT].VersionEntity; + +INSERT INTO ProjectEntity +SELECT * FROM [SOURCEPROJECT].ProjectEntity; + +INSERT INTO AssessmentSectionEntity ( + [AssessmentSectionEntityId], + [ProjectEntityId], + [Id], + [Name], + [Comments], + [Norm], + [HydraulicDatabaseVersion], + [HydraulicDatabaseLocation], + [Composition], + [ReferenceLinePointXml], + [Order]) +SELECT + [AssessmentSectionEntityId], + [ProjectEntityId], + [Id], + [Name], + [Comments], + [Norm], + [HydraulicDatabaseVersion], + [HydraulicDatabaseLocation], + [Composition], + [ReferenceLinePointXml], + [Order] +FROM [SOURCEPROJECT].AssessmentSectionEntity; + +INSERT INTO HydraulicLocationEntity +SELECT * FROM [SOURCEPROJECT].HydraulicLocationEntity; + +INSERT INTO HydraulicLocationOutputEntity +SELECT * FROM [SOURCEPROJECT].HydraulicLocationOutputEntity; \ No newline at end of file