Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs =================================================================== diff -u -r3e96590dbc35797c9eed68f737c44fb94c585071 -r44e8b00d548969e48987e6d3227c02e6555b2767 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision 3e96590dbc35797c9eed68f737c44fb94c585071) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/SoilProfileCreator.cs (.../SoilProfileCreator.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) @@ -56,6 +56,7 @@ { profile.SoilSurfaces.Add(new SoilProfileSurface { + Name = layerWithSoil.Soil.Name, IsAquifer = layerWithSoil.IsAquifer, Soil = layerWithSoil.Soil, Surface = CreateSurface(layerWithSoil, alreadyCreatedPoints, alreadyCreatedCurves, alreadyCreatedLoops), Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs =================================================================== diff -u -rc82fe11606b94b6aa6423c4b4cbfc151eb9b34a2 -r44e8b00d548969e48987e6d3227c02e6555b2767 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs (.../UpliftVanWaternetCreatorInputCreator.cs) (revision c82fe11606b94b6aa6423c4b4cbfc151eb9b34a2) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanWaternetCreatorInputCreator.cs (.../UpliftVanWaternetCreatorInputCreator.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) @@ -56,6 +56,8 @@ WaternetCreatorInput creatorInput = CreateBaseLocation(input); creatorInput.WaterLevelRiver = input.AssessmentLevel; + creatorInput.HeadInPlLine3 = input.AssessmentLevel; + creatorInput.HeadInPlLine4 = input.AssessmentLevel; creatorInput.WaterLevelPolder = input.WaterLevelPolderExtreme; creatorInput.UseDefaultOffsets = input.PhreaticLineOffsetsExtreme.UseDefaults; creatorInput.PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetsExtreme.BelowDikeTopAtRiver; @@ -88,6 +90,8 @@ WaternetCreatorInput creatorInput = CreateBaseLocation(input); creatorInput.WaterLevelRiver = input.WaterLevelRiverAverage; + creatorInput.HeadInPlLine3 = input.WaterLevelRiverAverage; + creatorInput.HeadInPlLine4 = input.WaterLevelRiverAverage; creatorInput.WaterLevelPolder = input.WaterLevelPolderDaily; creatorInput.UseDefaultOffsets = input.PhreaticLineOffsetsDaily.UseDefaults; creatorInput.PlLineOffsetBelowPointBRingtoetsWti2017 = input.PhreaticLineOffsetsDaily.BelowDikeTopAtRiver; Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs =================================================================== diff -u -rc82fe11606b94b6aa6423c4b4cbfc151eb9b34a2 -r44e8b00d548969e48987e6d3227c02e6555b2767 --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs (.../WaternetCreatorInputCreator.cs) (revision c82fe11606b94b6aa6423c4b4cbfc151eb9b34a2) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetCreatorInputCreator.cs (.../WaternetCreatorInputCreator.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) @@ -58,6 +58,8 @@ { DikeSoilScenario = LocationCreatorHelper.ConvertDikeSoilScenario(input.DikeSoilScenario), WaterLevelRiver = input.AssessmentLevel, + HeadInPlLine3 = input.AssessmentLevel, + HeadInPlLine4 = input.AssessmentLevel, WaterLevelRiverAverage = input.WaterLevelRiverAverage, WaterLevelPolder = input.WaterLevelPolder, DrainageConstructionPresent = input.DrainageConstruction.IsPresent, Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/LayerWithSoilCreatorTest.cs =================================================================== diff -u -r6706d60d5fc1100ffdfaac1cec64e6f61ea9be74 -r44e8b00d548969e48987e6d3227c02e6555b2767 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/LayerWithSoilCreatorTest.cs (.../LayerWithSoilCreatorTest.cs) (revision 6706d60d5fc1100ffdfaac1cec64e6f61ea9be74) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/LayerWithSoilCreatorTest.cs (.../LayerWithSoilCreatorTest.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) @@ -240,7 +240,7 @@ private static void AssertSoilLayerProperties(SoilLayer soilLayer, LayerWithSoil layerWithSoil) { Assert.AreEqual(soilLayer.IsAquifer, layerWithSoil.IsAquifer); - Assert.AreEqual(WaterPressureInterpolationModel.Hydrostatic, layerWithSoil.WaterPressureInterpolationModel); + Assert.AreEqual(CSharpWrapperWaterPressureInterpolationModel.Hydrostatic, layerWithSoil.WaterPressureInterpolationModel); Assert.IsNotNull(layerWithSoil.Soil); Assert.AreEqual(ShearStrengthModelType.Shansep, layerWithSoil.Soil.ShearStrengthAbovePhreaticLevelModel); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs =================================================================== diff -u -r3e96590dbc35797c9eed68f737c44fb94c585071 -r44e8b00d548969e48987e6d3227c02e6555b2767 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs (.../SoilProfileCreatorTest.cs) (revision 3e96590dbc35797c9eed68f737c44fb94c585071) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SoilProfileCreatorTest.cs (.../SoilProfileCreatorTest.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) @@ -273,10 +273,6 @@ innerLoop2 }, profile.Geometry.Loops, new LoopComparer()); - Assert.AreEqual(0, profile.Geometry.Left); - Assert.AreEqual(0, profile.Geometry.Bottom); - Assert.AreEqual(10, profile.Geometry.Right); - Assert.AreEqual(4, profile.SoilSurfaces.Count); Assert.AreEqual(4, profile.Geometry.Surfaces.Count); CollectionAssert.AreEqual(profile.SoilSurfaces.ToList() @@ -566,10 +562,6 @@ innerLoop2 }, profile.Geometry.Loops, new LoopComparer()); - Assert.AreEqual(0, profile.Geometry.Left); - Assert.AreEqual(0, profile.Geometry.Bottom); - Assert.AreEqual(10, profile.Geometry.Right); - Assert.AreEqual(4, profile.SoilSurfaces.Count); Assert.AreEqual(4, profile.Geometry.Surfaces.Count); CollectionAssert.AreEqual(profile.SoilSurfaces.ToList() Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanCalculationGridCreatorTest.cs =================================================================== diff -u -r08c064ff60c918a0368124ae6a2a75d7a063f805 -r44e8b00d548969e48987e6d3227c02e6555b2767 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanCalculationGridCreatorTest.cs (.../UpliftVanCalculationGridCreatorTest.cs) (revision 08c064ff60c918a0368124ae6a2a75d7a063f805) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanCalculationGridCreatorTest.cs (.../UpliftVanCalculationGridCreatorTest.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) @@ -80,7 +80,7 @@ Assert.AreEqual(rightGridZBottom, upliftVanCalculationGrid.RightGrid.GridZBottom); Assert.AreEqual(rightGridXNumber, upliftVanCalculationGrid.RightGrid.GridXNumber); Assert.AreEqual(rightGridZNumber, upliftVanCalculationGrid.RightGrid.GridZNumber); - CollectionAssert.IsEmpty(upliftVanCalculationGrid.TangentLines); + Assert.IsNull(upliftVanCalculationGrid.TangentLines); } [Test] @@ -107,7 +107,7 @@ Assert.AreEqual(0, upliftVanCalculationGrid.RightGrid.GridZBottom); Assert.AreEqual(0, upliftVanCalculationGrid.RightGrid.GridXNumber); Assert.AreEqual(0, upliftVanCalculationGrid.RightGrid.GridZNumber); - CollectionAssert.IsEmpty(upliftVanCalculationGrid.TangentLines); + Assert.IsNull(upliftVanCalculationGrid.TangentLines); } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanWaternetCreatorInputCreatorTest.cs =================================================================== diff -u -r5b08c78c06e509f66037e36657526b0cd8219e40 -r44e8b00d548969e48987e6d3227c02e6555b2767 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanWaternetCreatorInputCreatorTest.cs (.../UpliftVanWaternetCreatorInputCreatorTest.cs) (revision 5b08c78c06e509f66037e36657526b0cd8219e40) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/UpliftVanWaternetCreatorInputCreatorTest.cs (.../UpliftVanWaternetCreatorInputCreatorTest.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) @@ -29,7 +29,6 @@ using Riskeer.MacroStabilityInwards.KernelWrapper.Creators.Input; using Riskeer.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators.Input; using Riskeer.MacroStabilityInwards.Primitives; -using WaternetCreationMode = Riskeer.MacroStabilityInwards.KernelWrapper.Calculators.Input.WaternetCreationMode; namespace Riskeer.MacroStabilityInwards.KernelWrapper.Test.Creators.Input { @@ -100,54 +99,6 @@ } [Test] - public void CreateExtreme_InvalidWaternetCreationMode_ThrowInvalidEnumArgumentException() - { - // Setup - var input = new UpliftVanCalculatorInput( - new UpliftVanCalculatorInput.ConstructionProperties - { - SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), - DrainageConstruction = new DrainageConstruction(), - SlipPlane = new UpliftVanSlipPlane(), - WaternetCreationMode = (WaternetCreationMode) 99 - }); - - // Call - void Call() => UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); - - // Assert - string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{nameof(WaternetCreationMode)}'."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, message); - } - - [Test] - public void CreateExtreme_InvalidPlLineCreationMethod_ThrowInvalidEnumArgumentException() - { - // Setup - var input = new UpliftVanCalculatorInput( - new UpliftVanCalculatorInput.ConstructionProperties - { - SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), - DrainageConstruction = new DrainageConstruction(), - SlipPlane = new UpliftVanSlipPlane(), - PlLineCreationMethod = (PlLineCreationMethod) 99 - }); - - // Call - void Call() => UpliftVanWaternetCreatorInputCreator.CreateExtreme(input); - - // Assert - string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{nameof(PlLineCreationMethod)}'."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, message); - } - - [Test] [Combinatorial] public void CreateExtreme_WithInput_ReturnLocation([Values(true, false)] bool drainageConstructionPresent, [Values(true, false)] bool useDefaultOffsets) @@ -270,54 +221,6 @@ } [Test] - public void CreateDaily_InvalidWaternetCreationMode_ThrowInvalidEnumArgumentException() - { - // Setup - var input = new UpliftVanCalculatorInput( - new UpliftVanCalculatorInput.ConstructionProperties - { - SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), - DrainageConstruction = new DrainageConstruction(), - SlipPlane = new UpliftVanSlipPlane(), - WaternetCreationMode = (WaternetCreationMode) 99 - }); - - // Call - void Call() => UpliftVanWaternetCreatorInputCreator.CreateDaily(input); - - // Assert - string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{nameof(WaternetCreationMode)}'."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, message); - } - - [Test] - public void CreateDaily_InvalidPlLineCreationMethod_ThrowInvalidEnumArgumentException() - { - // Setup - var input = new UpliftVanCalculatorInput( - new UpliftVanCalculatorInput.ConstructionProperties - { - SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), - DrainageConstruction = new DrainageConstruction(), - SlipPlane = new UpliftVanSlipPlane(), - PlLineCreationMethod = (PlLineCreationMethod) 99 - }); - - // Call - void Call() => UpliftVanWaternetCreatorInputCreator.CreateDaily(input); - - // Assert - string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{nameof(PlLineCreationMethod)}'."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, message); - } - - [Test] [Combinatorial] public void CreateDaily_WithInput_ReturnLocation([Values(true, false)] bool drainageConstructionPresent, [Values(true, false)] bool useDefaultOffsets) @@ -380,8 +283,12 @@ { Assert.AreEqual(input.WaterLevelRiverAverage, waternetCreatorInput.WaterLevelRiverAverage); Assert.AreEqual(input.DrainageConstruction.IsPresent, waternetCreatorInput.DrainageConstructionPresent); - Assert.AreEqual(input.DrainageConstruction.XCoordinate, waternetCreatorInput.DrainageConstruction.X); - Assert.AreEqual(input.DrainageConstruction.ZCoordinate, waternetCreatorInput.DrainageConstruction.Z); + if (input.DrainageConstruction.IsPresent) + { + Assert.AreEqual(input.DrainageConstruction.XCoordinate, waternetCreatorInput.DrainageConstruction.X); + Assert.AreEqual(input.DrainageConstruction.ZCoordinate, waternetCreatorInput.DrainageConstruction.Z); + } + Assert.AreEqual(input.MinimumLevelPhreaticLineAtDikeTopRiver, waternetCreatorInput.MinimumLevelPhreaticLineAtDikeTopRiver); Assert.AreEqual(input.MinimumLevelPhreaticLineAtDikeTopPolder, waternetCreatorInput.MinimumLevelPhreaticLineAtDikeTopPolder); Assert.AreEqual(DikeSoilScenario.SandDikeOnClay, waternetCreatorInput.DikeSoilScenario); @@ -395,9 +302,9 @@ Assert.AreEqual(9.81, waternetCreatorInput.UnitWeightWater); } - private static void AssertIrrelevantValues(WaternetCreatorInput location) + private static void AssertIrrelevantValues(WaternetCreatorInput waternetCreatorInput) { - Assert.IsNaN(location.WaterLevelRiverLow); // Only for macro stability outwards + Assert.AreEqual(0, waternetCreatorInput.WaterLevelRiverLow); // Only for macro stability outwards } } } \ No newline at end of file Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/WaternetCreatorInputCreatorTest.cs =================================================================== diff -u -r5b08c78c06e509f66037e36657526b0cd8219e40 -r44e8b00d548969e48987e6d3227c02e6555b2767 --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/WaternetCreatorInputCreatorTest.cs (.../WaternetCreatorInputCreatorTest.cs) (revision 5b08c78c06e509f66037e36657526b0cd8219e40) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/WaternetCreatorInputCreatorTest.cs (.../WaternetCreatorInputCreatorTest.cs) (revision 44e8b00d548969e48987e6d3227c02e6555b2767) @@ -157,8 +157,12 @@ Assert.AreEqual(waterLevelRiverAverage, waternetCreatorInput.WaterLevelRiverAverage); Assert.AreEqual(waterLevelPolderExtreme, waternetCreatorInput.WaterLevelPolder); Assert.AreEqual(drainageConstruction.IsPresent, waternetCreatorInput.DrainageConstructionPresent); - Assert.AreEqual(drainageConstruction.XCoordinate, waternetCreatorInput.DrainageConstruction.X); - Assert.AreEqual(drainageConstruction.ZCoordinate, waternetCreatorInput.DrainageConstruction.Z); + if (drainageConstructionPresent) + { + Assert.AreEqual(drainageConstruction.XCoordinate, waternetCreatorInput.DrainageConstruction.X); + Assert.AreEqual(drainageConstruction.ZCoordinate, waternetCreatorInput.DrainageConstruction.Z); + } + Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopRiver, waternetCreatorInput.MinimumLevelPhreaticLineAtDikeTopRiver); Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopPolder, waternetCreatorInput.MinimumLevelPhreaticLineAtDikeTopPolder); Assert.AreEqual(phreaticLineOffsets.UseDefaults, waternetCreatorInput.UseDefaultOffsets); @@ -181,7 +185,7 @@ private static void AssertIrrelevantValues(WaternetCreatorInput waternetCreatorInput) { - Assert.IsNaN(waternetCreatorInput.WaterLevelRiverLow); // Only for macro stability outwards + Assert.AreEqual(0, waternetCreatorInput.WaterLevelRiverLow); // Only for macro stability outwards } } } \ No newline at end of file