Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/DrainageConstruction.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/DrainageConstruction.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/DrainageConstruction.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,69 @@ +// 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. + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input +{ + /// + /// A drainage construction which its properties have been adapted to perform a calculation. + /// + public class DrainageConstruction + { + /// + /// Creates a new instance of . + /// + /// is set to false; and + /// are set to . + public DrainageConstruction() + { + IsPresent = false; + XCoordinate = double.NaN; + ZCoordinate = double.NaN; + } + + /// + /// Creates a new instance of . + /// + /// The x coordinate of the drainage construction. + /// The z coordinate of the drainage construction. + /// is set to true. + public DrainageConstruction(double xCoordinate, double zCoordinate) + { + IsPresent = true; + XCoordinate = xCoordinate; + ZCoordinate = zCoordinate; + } + + /// + /// Gets whether the drainage construction is present. + /// + public bool IsPresent { get; } + + /// + /// Gets the x coordinate of the drainage construction. + /// + public double XCoordinate { get; } + + /// + /// Gets the z coordinate of the drainage construction. + /// + public double ZCoordinate { get; } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/LandwardDirection.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/LandwardDirection.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/LandwardDirection.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,32 @@ +// 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. + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input +{ + /// + /// All landward direction types. + /// + public enum LandwardDirection + { + PositiveX = 1, + NegativeX = 2 + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/PhreaticLineOffsets.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/PhreaticLineOffsets.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/PhreaticLineOffsets.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,91 @@ +// 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. + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input +{ + /// + /// Phreatic line offset values that are used to perform a calculation. + /// + public class PhreaticLineOffsets + { + /// + /// Creates a new instance of . + /// + /// is set to true; , + /// , + /// and are set to . + public PhreaticLineOffsets() + { + UseDefaults = true; + BelowDikeTopAtRiver = double.NaN; + BelowDikeTopAtPolder = double.NaN; + BelowDikeToeAtPolder = double.NaN; + BelowShoulderBaseInside = double.NaN; + } + + /// + /// Creates a new instance of . + /// + /// The offset of the phreatic line below dike top at river. + /// The offset of the phreatic line below dike top at polder. + /// The offset of the phreatic line below dike toe at polder. + /// The offset of the phreatic line below shoulder base inside. + /// is set to false. + public PhreaticLineOffsets(double belowDikeTopAtRiver, double belowDikeTopAtPolder, + double belowDikeToeAtPolder, double belowShoulderBaseInside) + { + UseDefaults = false; + BelowDikeTopAtRiver = belowDikeTopAtRiver; + BelowDikeTopAtPolder = belowDikeTopAtPolder; + BelowDikeToeAtPolder = belowDikeToeAtPolder; + BelowShoulderBaseInside = belowShoulderBaseInside; + } + + /// + /// Gets whether the default offsets should be used. + /// + public bool UseDefaults { get; } + + /// + /// Gets the offset of the phreatic line below dike top at river. + /// [m] + /// + public double BelowDikeTopAtRiver { get; } + + /// + /// Gets the offset of the phreatic line below dike top at polder. + /// [m] + /// + public double BelowDikeTopAtPolder { get; } + + /// + /// Gets the offset of the phreatic line below dike toe at polder. + /// [m] + /// + public double BelowDikeToeAtPolder { get; } + + /// + /// Gets the offset of the phreatic line below shoulder base inside. + /// [m] + /// + public double BelowShoulderBaseInside { get; } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/PlLineCreationMethod.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/PlLineCreationMethod.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/PlLineCreationMethod.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,37 @@ +// 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. + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input +{ + /// + /// All pl line creation method types. + /// + public enum PlLineCreationMethod + { + ExpertKnowledgeRrd = 1, + ExpertKnowledgeLinearInDike = 2, + RingtoetsWti2017 = 3, + DupuitStatic = 4, + DupuitDynamic = 5, + Sensors = 6, + None = 7 + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/WaternetCreationMode.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/WaternetCreationMode.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/Input/WaternetCreationMode.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,32 @@ +// 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. + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input +{ + /// + /// All waternet creation mode types. + /// + public enum WaternetCreationMode + { + CreateWaternet = 1, + FillInWaternetValues = 2 + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanCalculatorInput.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanCalculatorInput.cs (.../UpliftVanCalculatorInput.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanCalculatorInput.cs (.../UpliftVanCalculatorInput.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -120,10 +120,10 @@ /// public ConstructionProperties() { - WaternetCreationMode = UpliftVanWaternetCreationMode.CreateWaternet; - PlLineCreationMethod = UpliftVanPlLineCreationMethod.RingtoetsWti2017; + WaternetCreationMode = WaternetCreationMode.CreateWaternet; + PlLineCreationMethod = PlLineCreationMethod.RingtoetsWti2017; AssessmentLevel = double.NaN; - LandwardDirection = UpliftVanLandwardDirection.PositiveX; + LandwardDirection = LandwardDirection.PositiveX; WaterLevelRiverAverage = double.NaN; WaterLevelPolderExtreme = double.NaN; WaterLevelPolderDaily = double.NaN; @@ -147,12 +147,12 @@ /// /// Gets or sets the waternet creation mode. /// - public UpliftVanWaternetCreationMode WaternetCreationMode { internal get; set; } + public WaternetCreationMode WaternetCreationMode { internal get; set; } /// /// Gets or sets the pl line creation method. /// - public UpliftVanPlLineCreationMethod PlLineCreationMethod { internal get; set; } + public PlLineCreationMethod PlLineCreationMethod { internal get; set; } /// /// Gets or sets the outside high water level. @@ -163,7 +163,7 @@ /// /// Gets or sets the landward direction of . /// - public UpliftVanLandwardDirection LandwardDirection { internal get; set; } + public LandwardDirection LandwardDirection { internal get; set; } /// /// Gets or sets the surface line. @@ -178,17 +178,17 @@ /// /// Gets or sets the drainage construction. /// - public UpliftVanDrainageConstruction DrainageConstruction { internal get; set; } + public DrainageConstruction DrainageConstruction { internal get; set; } /// /// Gets or sets the phreatic line offsets under extreme circumstances. /// - public UpliftVanPhreaticLineOffsets PhreaticLineOffsetsExtreme { internal get; set; } + public PhreaticLineOffsets PhreaticLineOffsetsExtreme { internal get; set; } /// /// Gets or sets the phreatic line offsets under daily circumstances. /// - public UpliftVanPhreaticLineOffsets PhreaticLineOffsetsDaily { internal get; set; } + public PhreaticLineOffsets PhreaticLineOffsetsDaily { internal get; set; } /// /// Gets or sets the slip plane. @@ -318,12 +318,12 @@ /// /// Gets the waternet creation mode. /// - public UpliftVanWaternetCreationMode WaternetCreationMode { get; } + public WaternetCreationMode WaternetCreationMode { get; } /// /// Gets the pl line creation method. /// - public UpliftVanPlLineCreationMethod PlLineCreationMethod { get; } + public PlLineCreationMethod PlLineCreationMethod { get; } /// /// Gets the outside high water level. @@ -334,7 +334,7 @@ /// /// Gets the landward direction of . /// - public UpliftVanLandwardDirection LandwardDirection { get; } + public LandwardDirection LandwardDirection { get; } /// /// Gets the surface line. @@ -349,17 +349,17 @@ /// /// Gets the drainage construction. /// - public UpliftVanDrainageConstruction DrainageConstruction { get; } + public DrainageConstruction DrainageConstruction { get; } /// /// Gets the phreatic line offsets under extreme circumstances. /// - public UpliftVanPhreaticLineOffsets PhreaticLineOffsetsExtreme { get; } + public PhreaticLineOffsets PhreaticLineOffsetsExtreme { get; } /// /// Gets the phreatic line offsets under daily circumstances. /// - public UpliftVanPhreaticLineOffsets PhreaticLineOffsetsDaily { get; } + public PhreaticLineOffsets PhreaticLineOffsetsDaily { get; } /// /// Gets the slip plane. Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanDrainageConstruction.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanLandwardDirection.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanPhreaticLineOffsets.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanPlLineCreationMethod.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Calculators/UpliftVan/Input/UpliftVanWaternetCreationMode.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/StabilityLocationCreator.cs =================================================================== diff -u -r7822834024ae12c82ec93ba3f57556cb4a503296 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/StabilityLocationCreator.cs (.../StabilityLocationCreator.cs) (revision 7822834024ae12c82ec93ba3f57556cb4a503296) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/StabilityLocationCreator.cs (.../StabilityLocationCreator.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -26,6 +26,10 @@ using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; using Ringtoets.MacroStabilityInwards.Primitives; +using PlLineCreationMethod = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.PlLineCreationMethod; +using WaternetCreationMode = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.WaternetCreationMode; +using WTIStabilityPlLineCreationMethod = Deltares.WaternetCreator.PlLineCreationMethod; +using WTIStabilityWaternetCreationMode = Deltares.WaternetCreator.WaternetCreationMode; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators.Input { @@ -166,68 +170,68 @@ } /// - /// Converts a into a . + /// Converts a into a . /// - /// The to convert. - /// A based on . + /// The to convert. + /// A based on . /// Thrown when /// is an invalid value. /// Thrown when /// is a valid value but unsupported. - private static WaternetCreationMode ConvertWaternetCreationMode(UpliftVanWaternetCreationMode waternetCreationMode) + private static WTIStabilityWaternetCreationMode ConvertWaternetCreationMode(WaternetCreationMode waternetCreationMode) { - if (!Enum.IsDefined(typeof(UpliftVanWaternetCreationMode), waternetCreationMode)) + if (!Enum.IsDefined(typeof(WaternetCreationMode), waternetCreationMode)) { throw new InvalidEnumArgumentException(nameof(waternetCreationMode), (int) waternetCreationMode, - typeof(UpliftVanWaternetCreationMode)); + typeof(WaternetCreationMode)); } switch (waternetCreationMode) { - case UpliftVanWaternetCreationMode.CreateWaternet: - return WaternetCreationMode.CreateWaternet; - case UpliftVanWaternetCreationMode.FillInWaternetValues: - return WaternetCreationMode.FillInWaternetValues; + case WaternetCreationMode.CreateWaternet: + return WTIStabilityWaternetCreationMode.CreateWaternet; + case WaternetCreationMode.FillInWaternetValues: + return WTIStabilityWaternetCreationMode.FillInWaternetValues; default: throw new NotSupportedException(); } } /// - /// Converts a into a . + /// Converts a into a . /// - /// The to convert. - /// A based on . + /// The to convert. + /// A based on . /// Thrown when /// is an invalid value. /// Thrown when /// is a valid value but unsupported. - private static PlLineCreationMethod ConvertPlLineCreationMethod(UpliftVanPlLineCreationMethod plLineCreationMethod) + private static WTIStabilityPlLineCreationMethod ConvertPlLineCreationMethod(PlLineCreationMethod plLineCreationMethod) { - if (!Enum.IsDefined(typeof(UpliftVanPlLineCreationMethod), plLineCreationMethod)) + if (!Enum.IsDefined(typeof(PlLineCreationMethod), plLineCreationMethod)) { throw new InvalidEnumArgumentException(nameof(plLineCreationMethod), (int) plLineCreationMethod, - typeof(UpliftVanPlLineCreationMethod)); + typeof(PlLineCreationMethod)); } switch (plLineCreationMethod) { - case UpliftVanPlLineCreationMethod.ExpertKnowledgeRrd: - return PlLineCreationMethod.ExpertKnowledgeRrd; - case UpliftVanPlLineCreationMethod.ExpertKnowledgeLinearInDike: - return PlLineCreationMethod.ExpertKnowledgeLinearInDike; - case UpliftVanPlLineCreationMethod.RingtoetsWti2017: - return PlLineCreationMethod.RingtoetsWti2017; - case UpliftVanPlLineCreationMethod.DupuitStatic: - return PlLineCreationMethod.DupuitStatic; - case UpliftVanPlLineCreationMethod.DupuitDynamic: - return PlLineCreationMethod.DupuitDynamic; - case UpliftVanPlLineCreationMethod.Sensors: - return PlLineCreationMethod.Sensors; - case UpliftVanPlLineCreationMethod.None: - return PlLineCreationMethod.None; + case PlLineCreationMethod.ExpertKnowledgeRrd: + return WTIStabilityPlLineCreationMethod.ExpertKnowledgeRrd; + case PlLineCreationMethod.ExpertKnowledgeLinearInDike: + return WTIStabilityPlLineCreationMethod.ExpertKnowledgeLinearInDike; + case PlLineCreationMethod.RingtoetsWti2017: + return WTIStabilityPlLineCreationMethod.RingtoetsWti2017; + case PlLineCreationMethod.DupuitStatic: + return WTIStabilityPlLineCreationMethod.DupuitStatic; + case PlLineCreationMethod.DupuitDynamic: + return WTIStabilityPlLineCreationMethod.DupuitDynamic; + case PlLineCreationMethod.Sensors: + return WTIStabilityPlLineCreationMethod.Sensors; + case PlLineCreationMethod.None: + return WTIStabilityPlLineCreationMethod.None; default: throw new NotSupportedException(); } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs =================================================================== diff -u -r6139d8deb7b8f83cd06a4534f04ed18ecbada3b6 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs (.../SurfaceLineCreator.cs) (revision 6139d8deb7b8f83cd06a4534f04ed18ecbada3b6) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs (.../SurfaceLineCreator.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -25,9 +25,10 @@ using System.Linq; using Core.Common.Base.Geometry; using Deltares.WTIStability.Data.Geo; -using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels.UpliftVan; using Ringtoets.MacroStabilityInwards.Primitives; +using LandwardDirection = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.LandwardDirection; +using WTIStabilityLandwardDirection = Deltares.WTIStability.Data.Geo.LandwardDirection; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Creators.Input { @@ -49,7 +50,7 @@ /// is an invalid value. /// Thrown when /// is a valid value but unsupported. - public static SurfaceLine2 Create(MacroStabilityInwardsSurfaceLine surfaceLine, UpliftVanLandwardDirection landwardDirection) + public static SurfaceLine2 Create(MacroStabilityInwardsSurfaceLine surfaceLine, LandwardDirection landwardDirection) { if (surfaceLine == null) { @@ -80,29 +81,29 @@ } /// - /// Converts a into a . + /// Converts a into a . /// - /// The to convert. - /// A based on . + /// The to convert. + /// A based on . /// Thrown when /// is an invalid value. /// Thrown when /// is a valid value but unsupported. - private static LandwardDirection ConvertLandwardDirection(UpliftVanLandwardDirection landwardDirection) + private static WTIStabilityLandwardDirection ConvertLandwardDirection(LandwardDirection landwardDirection) { - if (!Enum.IsDefined(typeof(UpliftVanLandwardDirection), landwardDirection)) + if (!Enum.IsDefined(typeof(LandwardDirection), landwardDirection)) { throw new InvalidEnumArgumentException(nameof(landwardDirection), (int) landwardDirection, - typeof(UpliftVanLandwardDirection)); + typeof(LandwardDirection)); } switch (landwardDirection) { - case UpliftVanLandwardDirection.PositiveX: - return LandwardDirection.PositiveX; - case UpliftVanLandwardDirection.NegativeX: - return LandwardDirection.NegativeX; + case LandwardDirection.PositiveX: + return WTIStabilityLandwardDirection.PositiveX; + case LandwardDirection.NegativeX: + return WTIStabilityLandwardDirection.NegativeX; default: throw new NotSupportedException(); } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj =================================================================== diff -u -r557444d8587632235e4fda55487e6f322cde9ce7 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.csproj) (revision 557444d8587632235e4fda55487e6f322cde9ce7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Ringtoets.MacroStabilityInwards.KernelWrapper.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.csproj) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -43,13 +43,13 @@ Properties\GlobalAssembly.cs - - - - + + + + - + Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/DrainageConstructionConverter.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/DrainageConstructionConverter.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/DrainageConstructionConverter.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,58 @@ +// 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; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; +using Ringtoets.MacroStabilityInwards.Primitives; + +namespace Ringtoets.MacroStabilityInwards.Service.Converters +{ + /// + /// Converter to convert drainage properties + /// into . + /// + internal static class DrainageConstructionConverter + { + /// + /// Converts drainage properties + /// into . + /// + /// The input to get the properties from. + /// The converted . + /// Thrown when + /// is null. + public static DrainageConstruction Convert(MacroStabilityInwardsInput input) + { + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + bool isClayDike = input.DikeSoilScenario == MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay + || input.DikeSoilScenario == MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand; + + return !isClayDike && input.DrainageConstructionPresent + ? new DrainageConstruction(input.XCoordinateDrainageConstruction, input.ZCoordinateDrainageConstruction) + : new DrainageConstruction(); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/PhreaticLineOffsetsConverter.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/PhreaticLineOffsetsConverter.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/PhreaticLineOffsetsConverter.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,57 @@ +// 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; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; + +namespace Ringtoets.MacroStabilityInwards.Service.Converters +{ + /// + /// Converter to convert phreatic line offset properties + /// into . + /// + internal static class PhreaticLineOffsetsConverter + { + /// + /// Converts phreatic line offset properties + /// into . + /// + /// The input to get the properties from. + /// The converted . + /// Thrown when + /// is null. + public static PhreaticLineOffsets Convert(MacroStabilityInwardsLocationInput input) + { + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + return input.UseDefaultOffsets + ? new PhreaticLineOffsets() + : new PhreaticLineOffsets(input.PhreaticLineOffsetBelowDikeTopAtRiver, + input.PhreaticLineOffsetBelowDikeTopAtPolder, + input.PhreaticLineOffsetBelowDikeToeAtPolder, + input.PhreaticLineOffsetBelowShoulderBaseInside); + } + } +} \ No newline at end of file Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/UpliftVanDrainageConstructionConverter.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Converters/UpliftVanPhreaticLineOffsetsConverter.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs =================================================================== diff -u -r7371a70ed0751d341d41a7b951b780d286f83791 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs (.../MacroStabilityInwardsCalculationService.cs) (revision 7371a70ed0751d341d41a7b951b780d286f83791) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsCalculationService.cs (.../MacroStabilityInwardsCalculationService.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -26,13 +26,13 @@ using Ringtoets.Common.Service.ValidationRules; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Output; using Ringtoets.MacroStabilityInwards.KernelWrapper.Kernels; using Ringtoets.MacroStabilityInwards.Service.Converters; using Ringtoets.MacroStabilityInwards.Service.Properties; -using RingtoetsCommonServiceResources = Ringtoets.Common.Service.Properties.Resources; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.MacroStabilityInwards.Service @@ -194,15 +194,15 @@ return new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties { - WaternetCreationMode = UpliftVanWaternetCreationMode.CreateWaternet, - PlLineCreationMethod = UpliftVanPlLineCreationMethod.RingtoetsWti2017, + WaternetCreationMode = WaternetCreationMode.CreateWaternet, + PlLineCreationMethod = PlLineCreationMethod.RingtoetsWti2017, AssessmentLevel = inputParameters.AssessmentLevel, - LandwardDirection = UpliftVanLandwardDirection.PositiveX, + LandwardDirection = LandwardDirection.PositiveX, SurfaceLine = inputParameters.SurfaceLine, SoilProfile = SoilProfileConverter.Convert(inputParameters.SoilProfileUnderSurfaceLine), - DrainageConstruction = UpliftVanDrainageConstructionConverter.Convert(inputParameters), - PhreaticLineOffsetsExtreme = UpliftVanPhreaticLineOffsetsConverter.Convert(inputParameters.LocationInputExtreme), - PhreaticLineOffsetsDaily = UpliftVanPhreaticLineOffsetsConverter.Convert(inputParameters.LocationInputDaily), + DrainageConstruction = DrainageConstructionConverter.Convert(inputParameters), + PhreaticLineOffsetsExtreme = PhreaticLineOffsetsConverter.Convert(inputParameters.LocationInputExtreme), + PhreaticLineOffsetsDaily = PhreaticLineOffsetsConverter.Convert(inputParameters.LocationInputDaily), SlipPlane = UpliftVanSlipPlaneConverter.Convert(inputParameters), DikeSoilScenario = inputParameters.DikeSoilScenario, WaterLevelRiverAverage = inputParameters.WaterLevelRiverAverage, Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Ringtoets.MacroStabilityInwards.Service.csproj =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Ringtoets.MacroStabilityInwards.Service.csproj (.../Ringtoets.MacroStabilityInwards.Service.csproj) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/Ringtoets.MacroStabilityInwards.Service.csproj (.../Ringtoets.MacroStabilityInwards.Service.csproj) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -41,8 +41,8 @@ - - + + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/DrainageConstructionTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/DrainageConstructionTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/DrainageConstructionTest.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,60 @@ +// 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; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Input +{ + [TestFixture] + public class DrainageConstructionTest + { + [Test] + public void ParameterlessConstructor_ExpectedValues() + { + // Call + var drainageConstruction = new DrainageConstruction(); + + // Assert + Assert.IsFalse(drainageConstruction.IsPresent); + Assert.IsNaN(drainageConstruction.XCoordinate); + Assert.IsNaN(drainageConstruction.ZCoordinate); + } + + [Test] + public void ParameteredConstructor_ExpectedValues() + { + // Setup + var random = new Random(21); + double xCoordinate = random.NextDouble(); + double zCoordinate = random.NextDouble(); + + // Call + var drainageConstruction = new DrainageConstruction(xCoordinate, zCoordinate); + + // Assert + Assert.IsTrue(drainageConstruction.IsPresent); + Assert.AreEqual(xCoordinate, drainageConstruction.XCoordinate); + Assert.AreEqual(zCoordinate, drainageConstruction.ZCoordinate); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/LandwardDirectionTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/LandwardDirectionTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/LandwardDirectionTest.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,40 @@ +// 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; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Input +{ + [TestFixture] + public class LandwardDirectionTest + { + [Test] + public void Values_ExpectedValues() + { + // Assert + Assert.AreEqual(2, Enum.GetValues(typeof(LandwardDirection)).Length); + Assert.AreEqual(1, (int) LandwardDirection.PositiveX); + Assert.AreEqual(2, (int) LandwardDirection.NegativeX); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/PhreaticLineOffsetsTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/PhreaticLineOffsetsTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/PhreaticLineOffsetsTest.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,66 @@ +// 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; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Input +{ + [TestFixture] + public class PhreaticLineOffsetsTest + { + [Test] + public void ParameterlessConstructor_ExpectedValues() + { + // Call + var offsets = new PhreaticLineOffsets(); + + // Assert + Assert.IsTrue(offsets.UseDefaults); + Assert.IsNaN(offsets.BelowDikeTopAtRiver); + Assert.IsNaN(offsets.BelowDikeTopAtPolder); + Assert.IsNaN(offsets.BelowDikeToeAtPolder); + Assert.IsNaN(offsets.BelowShoulderBaseInside); + } + + [Test] + public void ParameteredConstructor_ExpectedValues() + { + // Setup + var random = new Random(11); + double belowDikeTopAtRiver = random.NextDouble(); + double belowDikeTopAtPolder = random.NextDouble(); + double belowDikeToeAtPolder = random.NextDouble(); + double belowShoulderBaseInside = random.NextDouble(); + + // Call + var offsets = new PhreaticLineOffsets(belowDikeTopAtRiver, belowDikeTopAtPolder, belowDikeToeAtPolder, belowShoulderBaseInside); + + // Assert + Assert.IsFalse(offsets.UseDefaults); + Assert.AreEqual(belowDikeTopAtRiver, offsets.BelowDikeTopAtRiver); + Assert.AreEqual(belowDikeTopAtPolder, offsets.BelowDikeTopAtPolder); + Assert.AreEqual(belowDikeToeAtPolder, offsets.BelowDikeToeAtPolder); + Assert.AreEqual(belowShoulderBaseInside, offsets.BelowShoulderBaseInside); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/PlLineCreationMethodTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/PlLineCreationMethodTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/PlLineCreationMethodTest.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -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 System; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Input +{ + [TestFixture] + public class PlLineCreationMethodTest + { + [Test] + public void Values_ExpectedValues() + { + // Assert + Assert.AreEqual(7, Enum.GetValues(typeof(PlLineCreationMethod)).Length); + Assert.AreEqual(1, (int) PlLineCreationMethod.ExpertKnowledgeRrd); + Assert.AreEqual(2, (int) PlLineCreationMethod.ExpertKnowledgeLinearInDike); + Assert.AreEqual(3, (int) PlLineCreationMethod.RingtoetsWti2017); + Assert.AreEqual(4, (int) PlLineCreationMethod.DupuitStatic); + Assert.AreEqual(5, (int) PlLineCreationMethod.DupuitDynamic); + Assert.AreEqual(6, (int) PlLineCreationMethod.Sensors); + Assert.AreEqual(7, (int) PlLineCreationMethod.None); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/WaternetCreationModeTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/WaternetCreationModeTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Input/WaternetCreationModeTest.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,40 @@ +// 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; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; + +namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Calculators.Input +{ + [TestFixture] + public class WaternetCreationModeTest + { + [Test] + public void Values_ExpectedValues() + { + // Assert + Assert.AreEqual(2, Enum.GetValues(typeof(WaternetCreationMode)).Length); + Assert.AreEqual(1, (int) WaternetCreationMode.CreateWaternet); + Assert.AreEqual(2, (int) WaternetCreationMode.FillInWaternetValues); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/MacroStabilityInwardsCalculatorFactoryTest.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/MacroStabilityInwardsCalculatorFactoryTest.cs (.../MacroStabilityInwardsCalculatorFactoryTest.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/MacroStabilityInwardsCalculatorFactoryTest.cs (.../MacroStabilityInwardsCalculatorFactoryTest.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -21,6 +21,7 @@ using NUnit.Framework; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet; @@ -84,9 +85,9 @@ { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane() }), new TestMacroStabilityInwardsKernelFactory()); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanCalculatorInputTest.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanCalculatorInputTest.cs (.../UpliftVanCalculatorInputTest.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanCalculatorInputTest.cs (.../UpliftVanCalculatorInputTest.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -22,6 +22,7 @@ using System; using Core.Common.TestUtil; using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators.Input; using Ringtoets.MacroStabilityInwards.Primitives; @@ -51,13 +52,13 @@ double hRiverValue = random.NextDouble(); var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty); var soilProfile = new TestSoilProfile(); - var drainageConstruction = new UpliftVanDrainageConstruction(); - var phreaticLineOffsets = new UpliftVanPhreaticLineOffsets(); + var drainageConstruction = new DrainageConstruction(); + var phreaticLineOffsets = new PhreaticLineOffsets(); var slipPlane = new UpliftVanSlipPlane(); - var waternetCreationMode = random.NextEnumValue(); - var plLineCreationMethod = random.NextEnumValue(); - var landwardDirection = random.NextEnumValue(); + var waternetCreationMode = random.NextEnumValue(); + var plLineCreationMethod = random.NextEnumValue(); + var landwardDirection = random.NextEnumValue(); double waterLevelRiverAverage = random.Next(); double waterLevelPolderExtreme = random.Next(); double waterLevelPolderDaily = random.Next(); @@ -156,8 +157,8 @@ // Setup var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty); var soilProfile = new TestSoilProfile(); - var drainageConstruction = new UpliftVanDrainageConstruction(); - var phreaticLineOffsets = new UpliftVanPhreaticLineOffsets(); + var drainageConstruction = new DrainageConstruction(); + var phreaticLineOffsets = new PhreaticLineOffsets(); var slipPlane = new UpliftVanSlipPlane(); // Call @@ -195,9 +196,9 @@ Assert.IsFalse(input.CreateZones); Assert.IsFalse(input.AutomaticForbiddenZones); - Assert.AreEqual(UpliftVanWaternetCreationMode.CreateWaternet, input.WaternetCreationMode); - Assert.AreEqual(UpliftVanPlLineCreationMethod.RingtoetsWti2017, input.PlLineCreationMethod); - Assert.AreEqual(UpliftVanLandwardDirection.PositiveX, input.LandwardDirection); + Assert.AreEqual(WaternetCreationMode.CreateWaternet, input.WaternetCreationMode); + Assert.AreEqual(PlLineCreationMethod.RingtoetsWti2017, input.PlLineCreationMethod); + Assert.AreEqual(LandwardDirection.PositiveX, input.LandwardDirection); Assert.AreEqual(MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay, input.DikeSoilScenario); } @@ -209,9 +210,9 @@ new UpliftVanCalculatorInput.ConstructionProperties { SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane() }); @@ -227,9 +228,9 @@ new UpliftVanCalculatorInput.ConstructionProperties { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane() }); @@ -246,8 +247,8 @@ { SoilProfile = new TestSoilProfile(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), SlipPlane = new UpliftVanSlipPlane() }); @@ -264,9 +265,9 @@ { SoilProfile = new TestSoilProfile(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - DrainageConstruction = new UpliftVanDrainageConstruction(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets() + PhreaticLineOffsetsDaily = new PhreaticLineOffsets() }); // Assert @@ -282,9 +283,9 @@ { SoilProfile = new TestSoilProfile(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - DrainageConstruction = new UpliftVanDrainageConstruction(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets() + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets() }); // Assert @@ -300,9 +301,9 @@ { SoilProfile = new TestSoilProfile(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets() + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets() }); // Assert Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanDrainageConstructionTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanLandwardDirectionTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanPhreaticLineOffsetsTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanPlLineCreationMethodTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/Input/UpliftVanWaternetCreationModeTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs (.../UpliftVanCalculatorTest.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/UpliftVan/UpliftVanCalculatorTest.cs (.../UpliftVanCalculatorTest.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -275,9 +275,9 @@ AssessmentLevel = random.NextDouble(), SurfaceLine = surfaceLine, SoilProfile = CreateValidSoilProfile(surfaceLine), - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), SlipPlane = new UpliftVanSlipPlane() }); } @@ -293,9 +293,9 @@ AssessmentLevel = random.NextDouble(), SurfaceLine = surfaceLine, SoilProfile = CreateValidSoilProfile(surfaceLine), - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), SlipPlane = new UpliftVanSlipPlane(), WaterLevelRiverAverage = random.Next(), WaterLevelPolderExtreme = random.Next(), Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/StabilityLocationCreatorTest.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/StabilityLocationCreatorTest.cs (.../StabilityLocationCreatorTest.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/StabilityLocationCreatorTest.cs (.../StabilityLocationCreatorTest.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -25,10 +25,15 @@ using Deltares.WaternetCreator; using Deltares.WTIStability; using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators.Input; using Ringtoets.MacroStabilityInwards.Primitives; +using PlLineCreationMethod = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.PlLineCreationMethod; +using WaternetCreationMode = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.WaternetCreationMode; +using WTIStabilityPlLineCreationMethod = Deltares.WaternetCreator.PlLineCreationMethod; +using WTIStabilityWaternetCreationMethod = Deltares.WaternetCreator.WaternetCreationMode; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Creators.Input { @@ -55,9 +60,9 @@ { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane(), DikeSoilScenario = (MacroStabilityInwardsDikeSoilScenario) 99 }); @@ -82,9 +87,9 @@ var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties { - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), SlipPlane = new UpliftVanSlipPlane(), @@ -107,34 +112,34 @@ { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane(), - WaternetCreationMode = (UpliftVanWaternetCreationMode) 99 + WaternetCreationMode = (WaternetCreationMode) 99 }); // Call TestDelegate test = () => StabilityLocationCreator.CreateExtreme(input); // Assert - string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{typeof(UpliftVanWaternetCreationMode).Name}'."; + string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{typeof(WaternetCreationMode).Name}'."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message); } [Test] - [TestCase(UpliftVanWaternetCreationMode.CreateWaternet, WaternetCreationMode.CreateWaternet)] - [TestCase(UpliftVanWaternetCreationMode.FillInWaternetValues, WaternetCreationMode.FillInWaternetValues)] - public void CreateExtreme_ValidWaternetCreationMode_ReturnStabilityLocationWithWaternetCreationMode(UpliftVanWaternetCreationMode upliftVanWaternetCreationMode, - WaternetCreationMode waternetCreationMode) + [TestCase(WaternetCreationMode.CreateWaternet, WTIStabilityWaternetCreationMethod.CreateWaternet)] + [TestCase(WaternetCreationMode.FillInWaternetValues, WTIStabilityWaternetCreationMethod.FillInWaternetValues)] + public void CreateExtreme_ValidWaternetCreationMode_ReturnStabilityLocationWithWaternetCreationMode(WaternetCreationMode upliftVanWaternetCreationMode, + WTIStabilityWaternetCreationMethod waternetCreationMode) { // Setup var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties { - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), SlipPlane = new UpliftVanSlipPlane(), @@ -157,39 +162,39 @@ { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane(), - PlLineCreationMethod = (UpliftVanPlLineCreationMethod) 99 + PlLineCreationMethod = (PlLineCreationMethod) 99 }); // Call TestDelegate test = () => StabilityLocationCreator.CreateExtreme(input); // Assert - string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{typeof(UpliftVanPlLineCreationMethod).Name}'."; + string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{typeof(PlLineCreationMethod).Name}'."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message); } [Test] - [TestCase(UpliftVanPlLineCreationMethod.ExpertKnowledgeRrd, PlLineCreationMethod.ExpertKnowledgeRrd)] - [TestCase(UpliftVanPlLineCreationMethod.ExpertKnowledgeLinearInDike, PlLineCreationMethod.ExpertKnowledgeLinearInDike)] - [TestCase(UpliftVanPlLineCreationMethod.RingtoetsWti2017, PlLineCreationMethod.RingtoetsWti2017)] - [TestCase(UpliftVanPlLineCreationMethod.DupuitStatic, PlLineCreationMethod.DupuitStatic)] - [TestCase(UpliftVanPlLineCreationMethod.DupuitDynamic, PlLineCreationMethod.DupuitDynamic)] - [TestCase(UpliftVanPlLineCreationMethod.Sensors, PlLineCreationMethod.Sensors)] - [TestCase(UpliftVanPlLineCreationMethod.None, PlLineCreationMethod.None)] - public void CreateExtreme_ValidPlLineCreationMethod_ReturnStabilityLocationWithWaternetCreationMode(UpliftVanPlLineCreationMethod upliftVanPlLineCreationMethod, - PlLineCreationMethod plLineCreationMethod) + [TestCase(PlLineCreationMethod.ExpertKnowledgeRrd, WTIStabilityPlLineCreationMethod.ExpertKnowledgeRrd)] + [TestCase(PlLineCreationMethod.ExpertKnowledgeLinearInDike, WTIStabilityPlLineCreationMethod.ExpertKnowledgeLinearInDike)] + [TestCase(PlLineCreationMethod.RingtoetsWti2017, WTIStabilityPlLineCreationMethod.RingtoetsWti2017)] + [TestCase(PlLineCreationMethod.DupuitStatic, WTIStabilityPlLineCreationMethod.DupuitStatic)] + [TestCase(PlLineCreationMethod.DupuitDynamic, WTIStabilityPlLineCreationMethod.DupuitDynamic)] + [TestCase(PlLineCreationMethod.Sensors, WTIStabilityPlLineCreationMethod.Sensors)] + [TestCase(PlLineCreationMethod.None, WTIStabilityPlLineCreationMethod.None)] + public void CreateExtreme_ValidPlLineCreationMethod_ReturnStabilityLocationWithWaternetCreationMode(PlLineCreationMethod upliftVanPlLineCreationMethod, + WTIStabilityPlLineCreationMethod expectedPlLineCreationMethod) { // Setup var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties { - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), SlipPlane = new UpliftVanSlipPlane(), @@ -200,7 +205,7 @@ StabilityLocation location = StabilityLocationCreator.CreateExtreme(input); // Assert - Assert.AreEqual(plLineCreationMethod, location.PlLineCreationMethod); + Assert.AreEqual(expectedPlLineCreationMethod, location.PlLineCreationMethod); } [Test] @@ -224,13 +229,13 @@ double piezometricHeadPhreaticLine2Inwards = random.Next(); double penetrationLength = random.Next(); - UpliftVanDrainageConstruction drainageConstruction = drainageConstructionPresent - ? new UpliftVanDrainageConstruction(random.Next(), random.Next()) - : new UpliftVanDrainageConstruction(); - UpliftVanPhreaticLineOffsets phreaticLineOffsets = useDefaultOffsets - ? new UpliftVanPhreaticLineOffsets() - : new UpliftVanPhreaticLineOffsets(random.Next(), random.Next(), - random.Next(), random.Next()); + DrainageConstruction drainageConstruction = drainageConstructionPresent + ? new DrainageConstruction(random.Next(), random.Next()) + : new DrainageConstruction(); + PhreaticLineOffsets phreaticLineOffsets = useDefaultOffsets + ? new PhreaticLineOffsets() + : new PhreaticLineOffsets(random.Next(), random.Next(), + random.Next(), random.Next()); var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties @@ -244,7 +249,7 @@ WaterLevelPolderExtreme = waterLevelPolderExtreme, DrainageConstruction = drainageConstruction, PhreaticLineOffsetsExtreme = phreaticLineOffsets, - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), MinimumLevelPhreaticLineAtDikeTopRiver = minimumLevelPhreaticLineAtDikeTopRiver, MinimumLevelPhreaticLineAtDikeTopPolder = minimumLevelPhreaticLineAtDikeTopPolder, AdjustPhreaticLine3And4ForUplift = adjustPhreaticLine3And4ForUplift, @@ -262,8 +267,8 @@ // Assert Assert.AreEqual(DikeSoilScenario.SandDikeOnClay, location.DikeSoilScenario); - Assert.AreEqual(WaternetCreationMode.CreateWaternet, location.WaternetCreationMode); - Assert.AreEqual(PlLineCreationMethod.RingtoetsWti2017, location.PlLineCreationMethod); + Assert.AreEqual(WTIStabilityWaternetCreationMethod.CreateWaternet, location.WaternetCreationMode); + Assert.AreEqual(WTIStabilityPlLineCreationMethod.RingtoetsWti2017, location.PlLineCreationMethod); Assert.AreEqual(assessmentLevel, location.WaterLevelRiver); Assert.AreEqual(assessmentLevel, location.HeadInPlLine3); Assert.AreEqual(assessmentLevel, location.HeadInPlLine4); @@ -311,9 +316,9 @@ { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane(), DikeSoilScenario = (MacroStabilityInwardsDikeSoilScenario) 99 }); @@ -338,9 +343,9 @@ var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties { - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), SlipPlane = new UpliftVanSlipPlane(), @@ -363,45 +368,45 @@ { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane(), - WaternetCreationMode = (UpliftVanWaternetCreationMode) 99 + WaternetCreationMode = (WaternetCreationMode) 99 }); // Call TestDelegate test = () => StabilityLocationCreator.CreateDaily(input); // Assert - string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{typeof(UpliftVanWaternetCreationMode).Name}'."; + string message = $"The value of argument 'waternetCreationMode' ({99}) is invalid for Enum type '{typeof(WaternetCreationMode).Name}'."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message); } [Test] - [TestCase(UpliftVanWaternetCreationMode.CreateWaternet, WaternetCreationMode.CreateWaternet)] - [TestCase(UpliftVanWaternetCreationMode.FillInWaternetValues, WaternetCreationMode.FillInWaternetValues)] - public void CreateDaily_ValidWaternetCreationMode_ReturnStabilityLocationWithWaternetCreationMode(UpliftVanWaternetCreationMode upliftVanWaternetCreationMode, - WaternetCreationMode waternetCreationMode) + [TestCase(WaternetCreationMode.CreateWaternet, WTIStabilityWaternetCreationMethod.CreateWaternet)] + [TestCase(WaternetCreationMode.FillInWaternetValues, WTIStabilityWaternetCreationMethod.FillInWaternetValues)] + public void CreateDaily_ValidWaternetCreationMode_ReturnStabilityLocationWithWaternetCreationMode(WaternetCreationMode waternetCreationMode, + WTIStabilityWaternetCreationMethod expectedWaternetCreationMode) { // Setup var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties { - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), SlipPlane = new UpliftVanSlipPlane(), - WaternetCreationMode = upliftVanWaternetCreationMode + WaternetCreationMode = waternetCreationMode }); // Call StabilityLocation location = StabilityLocationCreator.CreateDaily(input); // Assert - Assert.AreEqual(waternetCreationMode, location.WaternetCreationMode); + Assert.AreEqual(expectedWaternetCreationMode, location.WaternetCreationMode); } [Test] @@ -413,50 +418,50 @@ { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane(), - PlLineCreationMethod = (UpliftVanPlLineCreationMethod) 99 + PlLineCreationMethod = (PlLineCreationMethod) 99 }); // Call TestDelegate test = () => StabilityLocationCreator.CreateDaily(input); // Assert - string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{typeof(UpliftVanPlLineCreationMethod).Name}'."; + string message = $"The value of argument 'plLineCreationMethod' ({99}) is invalid for Enum type '{typeof(PlLineCreationMethod).Name}'."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message); } [Test] - [TestCase(UpliftVanPlLineCreationMethod.ExpertKnowledgeRrd, PlLineCreationMethod.ExpertKnowledgeRrd)] - [TestCase(UpliftVanPlLineCreationMethod.ExpertKnowledgeLinearInDike, PlLineCreationMethod.ExpertKnowledgeLinearInDike)] - [TestCase(UpliftVanPlLineCreationMethod.RingtoetsWti2017, PlLineCreationMethod.RingtoetsWti2017)] - [TestCase(UpliftVanPlLineCreationMethod.DupuitStatic, PlLineCreationMethod.DupuitStatic)] - [TestCase(UpliftVanPlLineCreationMethod.DupuitDynamic, PlLineCreationMethod.DupuitDynamic)] - [TestCase(UpliftVanPlLineCreationMethod.Sensors, PlLineCreationMethod.Sensors)] - [TestCase(UpliftVanPlLineCreationMethod.None, PlLineCreationMethod.None)] - public void CreateDaily_ValidPlLineCreationMethod_ReturnStabilityLocationWithWaternetCreationMode(UpliftVanPlLineCreationMethod upliftVanPlLineCreationMethod, - PlLineCreationMethod plLineCreationMethod) + [TestCase(PlLineCreationMethod.ExpertKnowledgeRrd, WTIStabilityPlLineCreationMethod.ExpertKnowledgeRrd)] + [TestCase(PlLineCreationMethod.ExpertKnowledgeLinearInDike, WTIStabilityPlLineCreationMethod.ExpertKnowledgeLinearInDike)] + [TestCase(PlLineCreationMethod.RingtoetsWti2017, WTIStabilityPlLineCreationMethod.RingtoetsWti2017)] + [TestCase(PlLineCreationMethod.DupuitStatic, WTIStabilityPlLineCreationMethod.DupuitStatic)] + [TestCase(PlLineCreationMethod.DupuitDynamic, WTIStabilityPlLineCreationMethod.DupuitDynamic)] + [TestCase(PlLineCreationMethod.Sensors, WTIStabilityPlLineCreationMethod.Sensors)] + [TestCase(PlLineCreationMethod.None, WTIStabilityPlLineCreationMethod.None)] + public void CreateDaily_ValidPlLineCreationMethod_ReturnStabilityLocationWithWaternetCreationMode(PlLineCreationMethod plLineCreationMethod, + WTIStabilityPlLineCreationMethod expectedPlLineCreationMethod) { // Setup var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties { - DrainageConstruction = new UpliftVanDrainageConstruction(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), SlipPlane = new UpliftVanSlipPlane(), - PlLineCreationMethod = upliftVanPlLineCreationMethod + PlLineCreationMethod = plLineCreationMethod }); // Call StabilityLocation location = StabilityLocationCreator.CreateDaily(input); // Assert - Assert.AreEqual(plLineCreationMethod, location.PlLineCreationMethod); + Assert.AreEqual(expectedPlLineCreationMethod, location.PlLineCreationMethod); } [Test] @@ -479,13 +484,13 @@ double piezometricHeadPhreaticLine2Outwards = random.Next(); double piezometricHeadPhreaticLine2Inwards = random.Next(); - UpliftVanDrainageConstruction drainageConstruction = drainageConstructionPresent - ? new UpliftVanDrainageConstruction(random.Next(), random.Next()) - : new UpliftVanDrainageConstruction(); - UpliftVanPhreaticLineOffsets phreaticLineOffsets = useDefaultOffsets - ? new UpliftVanPhreaticLineOffsets() - : new UpliftVanPhreaticLineOffsets(random.Next(), random.Next(), - random.Next(), random.Next()); + DrainageConstruction drainageConstruction = drainageConstructionPresent + ? new DrainageConstruction(random.Next(), random.Next()) + : new DrainageConstruction(); + PhreaticLineOffsets phreaticLineOffsets = useDefaultOffsets + ? new PhreaticLineOffsets() + : new PhreaticLineOffsets(random.Next(), random.Next(), + random.Next(), random.Next()); var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties @@ -498,7 +503,7 @@ WaterLevelRiverAverage = waterLevelRiverAverage, WaterLevelPolderDaily = waterLevelPolderDaily, DrainageConstruction = drainageConstruction, - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), PhreaticLineOffsetsDaily = phreaticLineOffsets, MinimumLevelPhreaticLineAtDikeTopRiver = minimumLevelPhreaticLineAtDikeTopRiver, MinimumLevelPhreaticLineAtDikeTopPolder = minimumLevelPhreaticLineAtDikeTopPolder, @@ -517,8 +522,8 @@ // Assert Assert.AreEqual(DikeSoilScenario.SandDikeOnClay, location.DikeSoilScenario); - Assert.AreEqual(WaternetCreationMode.CreateWaternet, location.WaternetCreationMode); - Assert.AreEqual(PlLineCreationMethod.RingtoetsWti2017, location.PlLineCreationMethod); + Assert.AreEqual(WTIStabilityWaternetCreationMethod.CreateWaternet, location.WaternetCreationMode); + Assert.AreEqual(WTIStabilityPlLineCreationMethod.RingtoetsWti2017, location.PlLineCreationMethod); Assert.AreEqual(waterLevelRiverAverage, location.WaterLevelRiver); Assert.AreEqual(waterLevelRiverAverage, location.HeadInPlLine3); Assert.AreEqual(waterLevelRiverAverage, location.HeadInPlLine4); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SurfaceLineCreatorTest.cs =================================================================== diff -u -r8f0b11c80c0e905ddd71ea14f4cc23f34e24cb32 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SurfaceLineCreatorTest.cs (.../SurfaceLineCreatorTest.cs) (revision 8f0b11c80c0e905ddd71ea14f4cc23f34e24cb32) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/Input/SurfaceLineCreatorTest.cs (.../SurfaceLineCreatorTest.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -26,9 +26,10 @@ using Core.Common.TestUtil; using Deltares.WTIStability.Data.Geo; using NUnit.Framework; -using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Creators.Input; using Ringtoets.MacroStabilityInwards.Primitives; +using LandwardDirection = Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input.LandwardDirection; +using WTIStabilityLandwardDirection = Deltares.WTIStability.Data.Geo.LandwardDirection; namespace Ringtoets.MacroStabilityInwards.KernelWrapper.Test.Creators.Input { @@ -39,7 +40,7 @@ public void Create_SurfaceLineNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => SurfaceLineCreator.Create(null, UpliftVanLandwardDirection.PositiveX); + TestDelegate call = () => SurfaceLineCreator.Create(null, LandwardDirection.PositiveX); // Assert var exception = Assert.Throws(call); @@ -54,7 +55,7 @@ var surfaceLine = new MacroStabilityInwardsSurfaceLine(name); // Call - SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, UpliftVanLandwardDirection.PositiveX); + SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, LandwardDirection.PositiveX); // Assert AssertGeneralValues(name, actual); @@ -75,7 +76,7 @@ }); // Call - SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, UpliftVanLandwardDirection.PositiveX); + SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, LandwardDirection.PositiveX); // Assert AssertGeneralValues(name, actual); @@ -99,7 +100,7 @@ }); // Call - SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, UpliftVanLandwardDirection.PositiveX); + SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, LandwardDirection.PositiveX); // Assert AssertGeneralValues(name, actual); @@ -125,7 +126,7 @@ }); // Call - SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, UpliftVanLandwardDirection.PositiveX); + SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, LandwardDirection.PositiveX); // Assert AssertGeneralValues(name, actual); @@ -156,7 +157,7 @@ }); // Call - SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, UpliftVanLandwardDirection.PositiveX); + SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, LandwardDirection.PositiveX); // Assert AssertGeneralValues(name, actual); @@ -212,7 +213,7 @@ surfaceLine.SetDikeTopAtRiverAt(geometry[13]); // Call - SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, UpliftVanLandwardDirection.PositiveX); + SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, LandwardDirection.PositiveX); // Assert AssertGeneralValues(name, actual); @@ -252,28 +253,28 @@ var surfaceLine = new MacroStabilityInwardsSurfaceLine(name); // Call - TestDelegate test = () => SurfaceLineCreator.Create(surfaceLine, (UpliftVanLandwardDirection) 99); + TestDelegate test = () => SurfaceLineCreator.Create(surfaceLine, (LandwardDirection) 99); // Assert - string message = $"The value of argument 'landwardDirection' ({99}) is invalid for Enum type '{typeof(UpliftVanLandwardDirection).Name}'."; + string message = $"The value of argument 'landwardDirection' ({99}) is invalid for Enum type '{typeof(LandwardDirection).Name}'."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message); } - [TestCase(UpliftVanLandwardDirection.PositiveX, LandwardDirection.PositiveX)] - [TestCase(UpliftVanLandwardDirection.NegativeX, LandwardDirection.NegativeX)] - public void Create_ValidLandwardDirection_CreateSurfaceLineWithLandwardDirection(UpliftVanLandwardDirection upliftVanLandwardDirection, - LandwardDirection landwardDirection) + [TestCase(LandwardDirection.PositiveX, WTIStabilityLandwardDirection.PositiveX)] + [TestCase(LandwardDirection.NegativeX, WTIStabilityLandwardDirection.NegativeX)] + public void Create_ValidLandwardDirection_CreateSurfaceLineWithLandwardDirection(LandwardDirection landwardDirection, + WTIStabilityLandwardDirection expectedLandwardDirection) { // Setup const string name = "Surface line with landward direction"; var surfaceLine = new MacroStabilityInwardsSurfaceLine(name); // Call - SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, upliftVanLandwardDirection); + SurfaceLine2 actual = SurfaceLineCreator.Create(surfaceLine, landwardDirection); // Assert AssertGeneralValues(name, actual); - Assert.AreEqual(landwardDirection, actual.LandwardDirection); + Assert.AreEqual(expectedLandwardDirection, actual.LandwardDirection); } private static void AssertGeneralValues(string name, SurfaceLine2 actual) Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj =================================================================== diff -u -r557444d8587632235e4fda55487e6f322cde9ce7 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj) (revision 557444d8587632235e4fda55487e6f322cde9ce7) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj (.../Ringtoets.MacroStabilityInwards.KernelWrapper.Test.csproj) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -62,13 +62,13 @@ Properties\GlobalAssembly.cs - - - - + + + + - + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/TestMacroStabilityInwardsCalculatorFactoryTest.cs =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/TestMacroStabilityInwardsCalculatorFactoryTest.cs (.../TestMacroStabilityInwardsCalculatorFactoryTest.cs) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Test/Calculators/TestMacroStabilityInwardsCalculatorFactoryTest.cs (.../TestMacroStabilityInwardsCalculatorFactoryTest.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -21,6 +21,7 @@ using NUnit.Framework; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Waternet; using Ringtoets.MacroStabilityInwards.KernelWrapper.TestUtil.Calculators; @@ -57,9 +58,9 @@ { SurfaceLine = new MacroStabilityInwardsSurfaceLine("test"), SoilProfile = new TestSoilProfile(), - PhreaticLineOffsetsExtreme = new UpliftVanPhreaticLineOffsets(), - PhreaticLineOffsetsDaily = new UpliftVanPhreaticLineOffsets(), - DrainageConstruction = new UpliftVanDrainageConstruction(), + PhreaticLineOffsetsExtreme = new PhreaticLineOffsets(), + PhreaticLineOffsetsDaily = new PhreaticLineOffsets(), + DrainageConstruction = new DrainageConstruction(), SlipPlane = new UpliftVanSlipPlane() }); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/DrainageConstructionConverterTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/DrainageConstructionConverterTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/DrainageConstructionConverterTest.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,115 @@ +// 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; +using Core.Common.Base.Data; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; +using Ringtoets.MacroStabilityInwards.Primitives; +using Ringtoets.MacroStabilityInwards.Service.Converters; + +namespace Ringtoets.MacroStabilityInwards.Service.Test.Converters +{ + [TestFixture] + public class DrainageConstructionConverterTest + { + [Test] + public void Convert_InputNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => DrainageConstructionConverter.Convert(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("input", exception.ParamName); + } + + [Test] + [TestCase(MacroStabilityInwardsDikeSoilScenario.SandDikeOnSand)] + [TestCase(MacroStabilityInwardsDikeSoilScenario.SandDikeOnClay)] + public void Convert_SandDikeAndDrainageConstructionPresentTrue_ReturnUpliftVanDrainageConstruction(MacroStabilityInwardsDikeSoilScenario soilScenario) + { + // Setup + var input = new MacroStabilityInwardsInput + { + DrainageConstructionPresent = true, + XCoordinateDrainageConstruction = (RoundedDouble) 2, + ZCoordinateDrainageConstruction = (RoundedDouble) 4, + DikeSoilScenario = soilScenario + }; + + // Call + DrainageConstruction drainageConstruction = DrainageConstructionConverter.Convert(input); + + // Assert + Assert.IsTrue(drainageConstruction.IsPresent); + Assert.AreEqual(input.XCoordinateDrainageConstruction, drainageConstruction.XCoordinate); + Assert.AreEqual(input.ZCoordinateDrainageConstruction, drainageConstruction.ZCoordinate); + } + + [TestCase(MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand)] + [TestCase(MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay)] + [TestCase(MacroStabilityInwardsDikeSoilScenario.SandDikeOnSand)] + [TestCase(MacroStabilityInwardsDikeSoilScenario.SandDikeOnClay)] + public void Convert_DrainageConstructionPresentFalse_ReturnUpliftVanDrainageConstruction(MacroStabilityInwardsDikeSoilScenario soilScenario) + { + // Setup + var input = new MacroStabilityInwardsInput + { + DrainageConstructionPresent = false, + XCoordinateDrainageConstruction = (RoundedDouble) 2, + ZCoordinateDrainageConstruction = (RoundedDouble) 4, + DikeSoilScenario = soilScenario + }; + + // Call + DrainageConstruction drainageConstruction = DrainageConstructionConverter.Convert(input); + + // Assert + Assert.IsFalse(drainageConstruction.IsPresent); + Assert.IsNaN(drainageConstruction.XCoordinate); + Assert.IsNaN(drainageConstruction.ZCoordinate); + } + + [TestCase(MacroStabilityInwardsDikeSoilScenario.ClayDikeOnSand)] + [TestCase(MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay)] + public void Convert_ClayDikeAndDrainageConstructionPresentTrue_ReturnUpliftVanDrainageConstruction(MacroStabilityInwardsDikeSoilScenario soilScenario) + { + // Setup + var input = new MacroStabilityInwardsInput + { + DrainageConstructionPresent = true, + XCoordinateDrainageConstruction = (RoundedDouble) 2, + ZCoordinateDrainageConstruction = (RoundedDouble) 4, + DikeSoilScenario = soilScenario + }; + + // Call + DrainageConstruction drainageConstruction = DrainageConstructionConverter.Convert(input); + + // Assert + Assert.IsFalse(drainageConstruction.IsPresent); + Assert.IsNaN(drainageConstruction.XCoordinate); + Assert.IsNaN(drainageConstruction.ZCoordinate); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/PhreaticLineOffsetsConverterTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/PhreaticLineOffsetsConverterTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/PhreaticLineOffsetsConverterTest.cs (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -0,0 +1,95 @@ +// 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; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; +using Ringtoets.MacroStabilityInwards.Service.Converters; + +namespace Ringtoets.MacroStabilityInwards.Service.Test.Converters +{ + [TestFixture] + public class PhreaticLineOffsetsConverterTest + { + [Test] + public void Convert_InputNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => PhreaticLineOffsetsConverter.Convert(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("input", exception.ParamName); + } + + [Test] + public void Convert_UseDefaultOffsetsTrue_ReturnUpliftVanPhreaticLineOffsets() + { + // Setup + var random = new Random(11); + var input = new MacroStabilityInwardsLocationInputExtreme + { + UseDefaultOffsets = true, + PhreaticLineOffsetBelowDikeTopAtRiver = random.NextRoundedDouble(), + PhreaticLineOffsetBelowDikeTopAtPolder = random.NextRoundedDouble(), + PhreaticLineOffsetBelowDikeToeAtPolder = random.NextRoundedDouble(), + PhreaticLineOffsetBelowShoulderBaseInside = random.NextRoundedDouble() + }; + + // Call + PhreaticLineOffsets offsets = PhreaticLineOffsetsConverter.Convert(input); + + // Assert + Assert.IsTrue(offsets.UseDefaults); + Assert.IsNaN(offsets.BelowDikeTopAtRiver); + Assert.IsNaN(offsets.BelowDikeTopAtPolder); + Assert.IsNaN(offsets.BelowDikeToeAtPolder); + Assert.IsNaN(offsets.BelowShoulderBaseInside); + } + + [Test] + public void Convert_UseDefaultOffsetsFalse_ReturnUpliftVanPhreaticLineOffsets() + { + // Setup + var random = new Random(11); + var input = new MacroStabilityInwardsLocationInputExtreme + { + UseDefaultOffsets = false, + PhreaticLineOffsetBelowDikeTopAtRiver = random.NextRoundedDouble(), + PhreaticLineOffsetBelowDikeTopAtPolder = random.NextRoundedDouble(), + PhreaticLineOffsetBelowDikeToeAtPolder = random.NextRoundedDouble(), + PhreaticLineOffsetBelowShoulderBaseInside = random.NextRoundedDouble() + }; + + // Call + PhreaticLineOffsets offsets = PhreaticLineOffsetsConverter.Convert(input); + + // Assert + Assert.IsFalse(offsets.UseDefaults); + Assert.AreEqual(input.PhreaticLineOffsetBelowDikeTopAtRiver, offsets.BelowDikeTopAtRiver); + Assert.AreEqual(input.PhreaticLineOffsetBelowDikeTopAtPolder, offsets.BelowDikeTopAtPolder); + Assert.AreEqual(input.PhreaticLineOffsetBelowDikeToeAtPolder, offsets.BelowDikeToeAtPolder); + Assert.AreEqual(input.PhreaticLineOffsetBelowShoulderBaseInside, offsets.BelowShoulderBaseInside); + } + } +} \ No newline at end of file Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/UpliftVanDrainageConstructionConverterTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 484ac98127f04b1d315c98fdada7bd9f5a004872 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Converters/UpliftVanPhreaticLineOffsetsConverterTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs =================================================================== diff -u -r7371a70ed0751d341d41a7b951b780d286f83791 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs (.../MacroStabilityInwardsCalculationServiceTest.cs) (revision 7371a70ed0751d341d41a7b951b780d286f83791) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs (.../MacroStabilityInwardsCalculationServiceTest.cs) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -31,6 +31,7 @@ using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.TestUtil; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators; +using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Input; using Ringtoets.MacroStabilityInwards.KernelWrapper.Calculators.UpliftVan.Output; @@ -569,9 +570,9 @@ AssertPhreaticLineOffsets(originalInput.LocationInputExtreme, actualInput.PhreaticLineOffsetsExtreme); AssertPhreaticLineOffsets(originalInput.LocationInputDaily, actualInput.PhreaticLineOffsetsDaily); AssertSlipPlaneInput(originalInput, actualInput.SlipPlane); - Assert.AreEqual(UpliftVanWaternetCreationMode.CreateWaternet, actualInput.WaternetCreationMode); - Assert.AreEqual(UpliftVanPlLineCreationMethod.RingtoetsWti2017, actualInput.PlLineCreationMethod); - Assert.AreEqual(UpliftVanLandwardDirection.PositiveX, actualInput.LandwardDirection); + Assert.AreEqual(WaternetCreationMode.CreateWaternet, actualInput.WaternetCreationMode); + Assert.AreEqual(PlLineCreationMethod.RingtoetsWti2017, actualInput.PlLineCreationMethod); + Assert.AreEqual(LandwardDirection.PositiveX, actualInput.LandwardDirection); Assert.AreSame(originalInput.SurfaceLine, actualInput.SurfaceLine); Assert.AreEqual(originalInput.AssessmentLevel, actualInput.AssessmentLevel); Assert.AreEqual(originalInput.DikeSoilScenario, actualInput.DikeSoilScenario); @@ -599,14 +600,14 @@ Assert.AreEqual(originalInput.SlipPlaneMinimumLength, actualInput.SlipPlaneMinimumLength); } - private static void AssertDrainageConstruction(MacroStabilityInwardsInput originalInput, UpliftVanDrainageConstruction actualInput) + private static void AssertDrainageConstruction(MacroStabilityInwardsInput originalInput, DrainageConstruction actualInput) { Assert.AreEqual(originalInput.DrainageConstructionPresent, actualInput.IsPresent); Assert.AreEqual(originalInput.XCoordinateDrainageConstruction, actualInput.XCoordinate); Assert.AreEqual(originalInput.ZCoordinateDrainageConstruction, actualInput.ZCoordinate); } - private static void AssertPhreaticLineOffsets(MacroStabilityInwardsLocationInput expected, UpliftVanPhreaticLineOffsets actual) + private static void AssertPhreaticLineOffsets(MacroStabilityInwardsLocationInput expected, PhreaticLineOffsets actual) { Assert.AreEqual(expected.UseDefaultOffsets, actual.UseDefaults); Assert.AreEqual(expected.PhreaticLineOffsetBelowDikeTopAtRiver, actual.BelowDikeTopAtRiver); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Ringtoets.MacroStabilityInwards.Service.Test.csproj =================================================================== diff -u -r2f475a02ae31bb68d351db98e3e7e82cb7456291 -r484ac98127f04b1d315c98fdada7bd9f5a004872 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Ringtoets.MacroStabilityInwards.Service.Test.csproj (.../Ringtoets.MacroStabilityInwards.Service.Test.csproj) (revision 2f475a02ae31bb68d351db98e3e7e82cb7456291) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/Ringtoets.MacroStabilityInwards.Service.Test.csproj (.../Ringtoets.MacroStabilityInwards.Service.Test.csproj) (revision 484ac98127f04b1d315c98fdada7bd9f5a004872) @@ -62,8 +62,8 @@ - - + +