Index: DamClients/DamUI/branches/DamUI 19.3/src/Dam/Tests/WaterBoardImporterTests.cs =================================================================== diff -u -r3751 -r3769 --- DamClients/DamUI/branches/DamUI 19.3/src/Dam/Tests/WaterBoardImporterTests.cs (.../WaterBoardImporterTests.cs) (revision 3751) +++ DamClients/DamUI/branches/DamUI 19.3/src/Dam/Tests/WaterBoardImporterTests.cs (.../WaterBoardImporterTests.cs) (revision 3769) @@ -280,7 +280,7 @@ var dikeToeAtPolder = location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType .DikeToeAtPolder); - Assert.AreEqual(soilProfileProbability.SoilProfile.TopLevel, dikeToeAtPolder.Z, cTolerance); + Assert.AreEqual(soilProfileProbability.SoilProfile.Layers[1].TopLevel, dikeToeAtPolder.Z, cTolerance); } // Compare reference waterboard to converted waterboard @@ -296,18 +296,26 @@ s => s.SoilProfile.Name.Equals(string.Format("{0}-{1}-{2}", referenceSoilProfileProbability.SoilProfile.Name, location.Name, soilProbabilityIndex))); for (var layerIndex = 0; - layerIndex < soilProfileProbability.SoilProfile.LayerCount; - layerIndex++) - Assert.AreEqual(referenceSoilProfileProbability.SoilProfile.Layers[layerIndex].Height, - soilProfileProbability.SoilProfile.Layers[layerIndex].Height, cTolerance, - string.Format( - "Location {0} Segment {1} soilProfile {2} Layer {3} ({4}/{5}), Org ({6}/{7})", - location.Name, location.Segment.Name, soilProfileProbability.SoilProfile.Name, - soilProfileProbability.SoilProfile.Layers[layerIndex], - soilProfileProbability.SoilProfile.Layers[layerIndex].TopLevel, - soilProfileProbability.SoilProfile.Layers[layerIndex].BottomLevel, - referenceSoilProfileProbability.SoilProfile.Layers[layerIndex].TopLevel, - referenceSoilProfileProbability.SoilProfile.Layers[layerIndex].BottomLevel)); + layerIndex < soilProfileProbability.SoilProfile.LayerCount; + layerIndex++) + { + // As the moved profile has a new top layer, make sure to compare the proper layers + if (layerIndex > 0) + { + Assert.AreEqual( + referenceSoilProfileProbability.SoilProfile.Layers[layerIndex - 1].Height, + soilProfileProbability.SoilProfile.Layers[layerIndex].Height, cTolerance, + string.Format( + "Location {0} Segment {1} soilProfile {2} Layer {3} ({4}/{5}), Org ({6}/{7})", + location.Name, location.Segment.Name, soilProfileProbability.SoilProfile.Name, + soilProfileProbability.SoilProfile.Layers[layerIndex], + soilProfileProbability.SoilProfile.Layers[layerIndex].TopLevel, + soilProfileProbability.SoilProfile.Layers[layerIndex].BottomLevel, + referenceSoilProfileProbability.SoilProfile.Layers[layerIndex - 1].TopLevel, + referenceSoilProfileProbability.SoilProfile.Layers[layerIndex - 1] + .BottomLevel)); + } + } } } }