Index: DamClients/DamUI/branches/DamUI 18.1/src/Dam/Tests/LoadCompatiblityTest.cs =================================================================== diff -u -r1734 -r2119 --- DamClients/DamUI/branches/DamUI 18.1/src/Dam/Tests/LoadCompatiblityTest.cs (.../LoadCompatiblityTest.cs) (revision 1734) +++ DamClients/DamUI/branches/DamUI 18.1/src/Dam/Tests/LoadCompatiblityTest.cs (.../LoadCompatiblityTest.cs) (revision 2119) @@ -21,12 +21,12 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using Deltares.Dam.Data; using Deltares.Dam.TestHelper; using Deltares.Geometry; -using Deltares.Geotechnics; using Deltares.Geotechnics.GeotechnicalGeometry; using Deltares.Geotechnics.Soils; using Deltares.Geotechnics.SurfaceLines; @@ -198,8 +198,8 @@ /// /// Compares the soil profiles. /// - /// The expected location. - /// The actual location. + /// The expected soilprofile1D. + /// The actual soilprofile1D. void CompareSoilProfiles(SoilProfile1D expectedSoilProfile1D, SoilProfile1D actualSoilProfile1D) { int expectedLayerCount = expectedSoilProfile1D.Layers.Count; @@ -217,8 +217,6 @@ [Category("Integration")] public void CanLoadVersion_1_3_3_1() { - //const string projectFilenameDelfland = @"..\..\..\data\Dam\Versions\V 1.3.3.1\Delfland\Traject1_metDSM.damx"; - //const string projectFilenameHd = @"..\..\..\data\Dam\Versions\V 1.3.3.1\HD\Oude Tonge GO.damx"; const string projectFilenameHhnk = @"..\..\..\data\Dam\Versions\V 1.3.3.1\HHNK\TPL_Hempolder.damx"; // HHNK (Hollands Noorderkwartier) @@ -333,12 +331,10 @@ [Category("Integration")] public void CanLoadVersion_1_5_2_1() { - //const string projectFilenameDelfland = @"..\..\..\data\Dam\Versions\V 1.5.2.1\Delfland\Traject1_metDSM.damx"; - //const string projectFilenameHd = @"..\..\..\data\Dam\Versions\V 1.5.2.1\HD\Oude Tonge GO.damx"; - const string projectFilenameHhnk = @"..\..\..\data\Dam\Versions\V 1.5.2.1\HHNK\TPL_Hempolder.damx"; + const string fullProjectFilename = @"..\..\..\data\Dam\Versions\V 1.5.2.1\HHNK\TPL_Hempolder.damx"; // HHNK (Hollands Noorderkwartier) - using (var projectData = ProjectLoader.LoadProjectData(projectFilenameHhnk)) + using (var projectData = ProjectLoader.LoadProjectData(fullProjectFilename)) { // Check data using (Location expectedLocation = CreateHhnkTplHempolder100()) @@ -360,29 +356,28 @@ [Test] [Category("Integration")] - public void CanLoadVersion_14_1_1_14() + [TestCase(@"HHNK\TPL_Hempolder.damx", @"HHNK\TPL_Hempolder0.soilmaterials.mdb", "TPL_Hempolder_0100")] + // [TestCase(@"HD\Oude Tonge GO.damx", @"HD\Oude Tonge GO0.soilmaterials.mdb", "GO_16_17_9")] + // [TestCase(@"Delfland\Traject1_metDSM.damx", @"Traject1_metDSM0.soilmaterials.mdb", "VDP1")] + // For above cases to run we have to create funcitons CreateHdOudeTongeGO_16_17_9() and CreateDelflandTraject1_metDSM0VDP1() + public void CanLoadVersion_14_1_1_14(string projectFilename, string expectedSoilbaseName, string locationName) { - //const string projectFilenameDelfland = @"..\..\..\data\Dam\Versions\V 14.1.1.14\Delfland\Traject1_metDSM.damx"; - //const string projectFilenameHd = @"..\..\..\data\Dam\Versions\V 14.1.1.14\HD\Oude Tonge GO.damx"; - const string projectFilenameHhnk = @"..\..\..\data\Dam\Versions\V 14.1.1.14\HHNK\TPL_Hempolder.damx"; + const string dataFolder = @"..\..\..\data\Dam\Versions\V 14.1.1.14\"; + string fullProjectFilename = Path.Combine(dataFolder, projectFilename); - // HHNK (Hollands Noorderkwartier) - using (var projectData = ProjectLoader.LoadProjectData(projectFilenameHhnk)) + using (var projectData = ProjectLoader.LoadProjectData(fullProjectFilename)) { // Check data using (Location expectedLocation = CreateHhnkTplHempolder100()) { - expectedLocation.SoildatabaseName = @"..\..\..\data\Dam\Versions\V 14.1.1.14\HHNK\TPL_Hempolder0.soilmaterials.mdb"; - Location actualLocation = projectData.Locations.Single(s => s.Name == "TPL_Hempolder_0100"); + expectedLocation.SoildatabaseName = Path.Combine(dataFolder, expectedSoilbaseName); + Location actualLocation = projectData.Locations.Single(s => s.Name == locationName); CompareSegments(expectedLocation, actualLocation); var result = compare.Compare(expectedLocation, actualLocation); Assert.AreEqual(0, result.Differences.Count, result.DifferencesString); CheckHempolderSurfaceline(actualLocation); - // TODO Implement for Delfland - - // TODO: Implement for HD (Hollandse Delta) } } } @@ -520,6 +515,62 @@ } } + [Test] + [Category("Integration")] + [TestCase(@"HHNK\TPL_Hempolder.damx", @"HHNK\TPL_Hempolder0.soilmaterials.mdb", "TPL_Hempolder_0100")] + //[TestCase(@"HD\Oude Tonge GO.damx", @"HD\Oude Tonge GO0.soilmaterials.mdb", "GO_16_17_9")] + //[TestCase(@"Delfland\Traject1_metDSM.damx", @"Traject1_metDSM0.soilmaterials.mdb", "VDP1")] + // For above cases to run we have to create funcitons CreateHdOudeTongeGO_16_17_9() and CreateDelflandTraject1_metDSM0VDP1() + public void CanLoadVersion_15_1_1_3(string projectFilename, string expectedSoilbaseName, string locationName) + { + const string dataFolder = @"..\..\..\data\Dam\Versions\V 14.1.1.14\"; + string fullProjectFilename = Path.Combine(dataFolder, projectFilename); + + using (var projectData = ProjectLoader.LoadProjectData(fullProjectFilename)) + { + // Check data + using (Location expectedLocation = CreateHhnkTplHempolder100()) + { + expectedLocation.SoildatabaseName = Path.Combine(dataFolder, expectedSoilbaseName); + Location actualLocation = projectData.Locations.Single(s => s.Name == locationName); + CompareSegments(expectedLocation, actualLocation); + var result = compare.Compare(expectedLocation, actualLocation); + Assert.AreEqual(0, result.Differences.Count, result.DifferencesString); + + CheckHempolderSurfaceline(actualLocation); + + } + } + } + + [Test] + [Category("Integration")] + [TestCase(@"HHNK\TPL_Hempolder.damx", @"HHNK\TPL_Hempolder0.soilmaterials.mdb", "TPL_Hempolder_0100")] + //[TestCase(@"HD\Oude Tonge GO.damx", @"HD\Oude Tonge GO0.soilmaterials.mdb", "GO_16_17_9")] + //[TestCase(@"Delfland\Traject1_metDSM.damx", @"Traject1_metDSM0.soilmaterials.mdb", "VDP1")] + // For above cases to run we have to create funcitons CreateHdOudeTongeGO_16_17_9() and CreateDelflandTraject1_metDSM0VDP1() + public void CanLoadVersion_18_1_3(string projectFilename, string expectedSoilbaseName, string locationName) + { + const string dataFolder = @"..\..\..\data\Dam\Versions\V 18.1.3\"; + string fullProjectFilename = Path.Combine(dataFolder, projectFilename); + + using (var projectData = ProjectLoader.LoadProjectData(fullProjectFilename)) + { + // Check data + using (Location expectedLocation = CreateHhnkTplHempolder100()) + { + expectedLocation.SoildatabaseName = Path.Combine(dataFolder, expectedSoilbaseName); + Location actualLocation = projectData.Locations.Single(s => s.Name == locationName); + CompareSegments(expectedLocation, actualLocation); + var result = compare.Compare(expectedLocation, actualLocation); + Assert.AreEqual(0, result.Differences.Count, result.DifferencesString); + + CheckHempolderSurfaceline(actualLocation); + + } + } + } + /// /// Test if the project can be saved and loaded with the current version of the source /// - Load old project