Index: Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/MigratedDatabaseReader.cs
===================================================================
diff -u
--- Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/MigratedDatabaseReader.cs (revision 0)
+++ Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/MigratedDatabaseReader.cs (revision a8ceb06ddf8e350872d2e81251760bd6fcf96056)
@@ -0,0 +1,65 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Data;
+using Core.Common.Base.IO;
+using Core.Common.IO.Readers;
+using NUnit.Framework;
+
+namespace Ringtoets.Migration.Core.TestUtil
+{
+ ///
+ /// Database reader for a migrated database.
+ ///
+ public class MigratedDatabaseReader : SqLiteDatabaseReaderBase
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The path of the database file to open.
+ /// Thrown when:
+ ///
+ /// The contains invalid characters.
+ /// No file could be found at .
+ /// Unable to open database file.
+ ///
+ ///
+ public MigratedDatabaseReader(string databaseFilePath) : base(databaseFilePath) {}
+
+ ///
+ /// Asserts that the results in one field with the value true.
+ ///
+ /// The query to execute.
+ /// The execution of
+ /// failed.
+ public void AssertReturnedDataIsValid(string queryString)
+ {
+ using (IDataReader dataReader = CreateDataReader(queryString))
+ {
+ Assert.IsTrue(dataReader.Read(), "No data can be read from the data reader " +
+ $"when using query '{queryString}'.");
+ Assert.AreEqual(1, dataReader.FieldCount, $"Expected one field, was {dataReader.FieldCount} " +
+ $"fields when using query '{queryString}'.");
+ Assert.AreEqual(1, dataReader[0], $"Result should be 1 when using query '{queryString}'.");
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/MigrationLogTestHelper.cs
===================================================================
diff -u
--- Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/MigrationLogTestHelper.cs (revision 0)
+++ Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/MigrationLogTestHelper.cs (revision a8ceb06ddf8e350872d2e81251760bd6fcf96056)
@@ -0,0 +1,45 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using NUnit.Framework;
+
+namespace Ringtoets.Migration.Core.TestUtil
+{
+ ///
+ /// Helper class for asserting content of migration log messages.
+ ///
+ public static class MigrationLogTestHelper
+ {
+ ///
+ /// Asserts whether corresponds to .
+ ///
+ /// The original .
+ /// The actual .
+ /// Thrown when
+ /// does not correspond to .
+ public static void AssertMigrationLogMessageEqual(MigrationLogMessage expected, MigrationLogMessage actual)
+ {
+ Assert.AreEqual(expected.ToVersion, actual.ToVersion);
+ Assert.AreEqual(expected.FromVersion, actual.FromVersion);
+ Assert.AreEqual(expected.Message, actual.Message);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/Ringtoets.Migration.Core.TestUtil.csproj
===================================================================
diff -u -rac2b9ed4b5c90bfc6a17d39b6f8193b8a70842f5 -ra8ceb06ddf8e350872d2e81251760bd6fcf96056
--- Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/Ringtoets.Migration.Core.TestUtil.csproj (.../Ringtoets.Migration.Core.TestUtil.csproj) (revision ac2b9ed4b5c90bfc6a17d39b6f8193b8a70842f5)
+++ Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/Ringtoets.Migration.Core.TestUtil.csproj (.../Ringtoets.Migration.Core.TestUtil.csproj) (revision a8ceb06ddf8e350872d2e81251760bd6fcf96056)
@@ -7,15 +7,55 @@
+
+ ..\..\..\..\packages\NUnit.3.8.1\lib\net40\nunit.framework.dll
+
+
+
+ ..\..\..\..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net40\System.Data.SQLite.dll
+
+
+
+
Copying.licenseheader
+
+
+
+ {3BBFD65B-B277-4E50-AE6D-BD24C3434609}
+ Core.Common.Base
+
+
+ {E344867E-9AC9-44C8-88A5-8185681679A9}
+ Core.Common.IO
+
+
+ {D749EE4C-CE50-4C17-BF01-9A953028C126}
+ Core.Common.TestUtil
+
+
+ {6A074D65-A81C-4C1C-8E24-F36C916E4ED7}
+ Ringtoets.Common.Util
+
+
+ {FAC55B92-E259-43D6-B9A1-5BDA6C834359}
+ Ringtoets.Migration.Core
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
\ No newline at end of file
Index: Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/RingtoetsProjectMigrationTestHelper.cs
===================================================================
diff -u
--- Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/RingtoetsProjectMigrationTestHelper.cs (revision 0)
+++ Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/RingtoetsProjectMigrationTestHelper.cs (revision a8ceb06ddf8e350872d2e81251760bd6fcf96056)
@@ -0,0 +1,88 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Collections.Generic;
+using Core.Common.TestUtil;
+using Ringtoets.Common.Util;
+
+namespace Ringtoets.Migration.Core.TestUtil
+{
+ ///
+ /// Class which provides file paths of the Ringtoets project files that can
+ /// be used for testing migration functionality.
+ ///
+ public static class RingtoetsProjectMigrationTestHelper
+ {
+ private static readonly TestDataPath testDataPath = TestDataPath.Application.Ringtoets.Migration.Core;
+
+ ///
+ /// Retrieves the file path of a Ringtoets project with the latest database version
+ /// format.
+ ///
+ /// A file path to a Ringtoets project file with the latest database version.
+ public static string GetLatestProjectFilePath()
+ {
+ string currentDatabaseVersion = RingtoetsVersionHelper.GetCurrentDatabaseVersion();
+ string versionSuffix = currentDatabaseVersion.Replace(".", string.Empty);
+ string projectFileName = $"MigrationTestProject{versionSuffix}.rtd";
+
+ return TestHelper.GetTestDataPath(testDataPath, projectFileName);
+ }
+
+ ///
+ /// Retrieves the file path of a Ringtoets project with an older database version,
+ /// which is supported for migration.
+ ///
+ /// A file path to an outdated Ringtoets project which is supported
+ /// for migration.
+ public static string GetOutdatedSupportedProjectFilePath()
+ {
+ const string projectFileName = "MigrationTestProject164.rtd";
+ return TestHelper.GetTestDataPath(testDataPath, projectFileName);
+ }
+
+ ///
+ /// Retrieves the version numbers of all Ringtoets projects with an older database version,
+ /// which are supported for the migration.
+ ///
+ /// An of all the version numbers of supported
+ /// outdated Ringtoets projects.
+ public static IEnumerable GetAllOutdatedSupportedProjectFileVersions()
+ {
+ yield return "164";
+ yield return "171";
+ yield return "172";
+ yield return "173";
+ }
+
+ ///
+ /// Retrieves the file path of a Ringtoets project with an unsupported database version
+ /// which is unsupported for migration.
+ ///
+ /// A file path to an outdated Ringtoets project which is unsupported for
+ /// migration.
+ public static string GetOutdatedUnSupportedProjectFilePath()
+ {
+ const string projectFileName = "UnsupportedVersion8.rtd";
+ return TestHelper.GetTestDataPath(testDataPath, projectFileName);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/packages.config
===================================================================
diff -u
--- Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/packages.config (revision 0)
+++ Ringtoets/Migration/test/Ringtoets.Migration.Core.TestUtil/packages.config (revision a8ceb06ddf8e350872d2e81251760bd6fcf96056)
@@ -0,0 +1,27 @@
+
+
+
+
+
+
\ No newline at end of file
Fisheye: Tag a8ceb06ddf8e350872d2e81251760bd6fcf96056 refers to a dead (removed) revision in file `Ringtoets/Storage/test/Ringtoets.Storage.Core.TestUtil/MigratedDatabaseReader.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag a8ceb06ddf8e350872d2e81251760bd6fcf96056 refers to a dead (removed) revision in file `Ringtoets/Storage/test/Ringtoets.Storage.Core.TestUtil/MigrationLogTestHelper.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.TestUtil/Ringtoets.Storage.Core.TestUtil.csproj
===================================================================
diff -u -r045072235b0878d2ed7407d4d5d9674250df1a6d -ra8ceb06ddf8e350872d2e81251760bd6fcf96056
--- Ringtoets/Storage/test/Ringtoets.Storage.Core.TestUtil/Ringtoets.Storage.Core.TestUtil.csproj (.../Ringtoets.Storage.Core.TestUtil.csproj) (revision 045072235b0878d2ed7407d4d5d9674250df1a6d)
+++ Ringtoets/Storage/test/Ringtoets.Storage.Core.TestUtil/Ringtoets.Storage.Core.TestUtil.csproj (.../Ringtoets.Storage.Core.TestUtil.csproj) (revision a8ceb06ddf8e350872d2e81251760bd6fcf96056)
@@ -27,10 +27,7 @@
-
-
-
Fisheye: Tag a8ceb06ddf8e350872d2e81251760bd6fcf96056 refers to a dead (removed) revision in file `Ringtoets/Storage/test/Ringtoets.Storage.Core.TestUtil/RingtoetsProjectMigrationTestHelper.cs'.
Fisheye: No comparison available. Pass `N' to diff?