Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverter.cs =================================================================== diff -u -r2977 -r2981 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverter.cs (.../PlLinesToWaternetConverter.cs) (revision 2977) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverter.cs (.../PlLinesToWaternetConverter.cs) (revision 2981) @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.Data; using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Deltares.DamEngine.Calculators.Interfaces; using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.PlLines; @@ -95,8 +93,13 @@ /// The to convert the with. /// The penetration length. /// A . + /// Thrown when or + /// is null. public static Waternet ConvertPlLineToWaternet(PlLines plLines, SoilProfile2D soilProfile, double penetrationLength) { + ThrowWhenPlLinesIsNull(plLines); + ThrowWhenSoilProfile1DIsNull(soilProfile); + // Get all the xCoordinates to make cross sections IEnumerable points = soilProfile.Surfaces.SelectMany(surf => surf.GeometrySurface.OuterLoop.CalcPoints); var xCoordinates = points.Select(point => point.X).OrderBy(x => x).Distinct().ToArray(); @@ -285,15 +288,15 @@ } /// - /// Throws when the 1D soil profile is not assigned. + /// Throws when the soil profile is not assigned. /// - /// The 1D soil profile. + /// The soil profile. /// - public static void ThrowWhenSoilProfile1DIsNull(SoilProfile1D soilProfile1D) + public static void ThrowWhenSoilProfile1DIsNull(SoilProfile soilProfile) { - if (soilProfile1D == null) + if (soilProfile == null) { - throw new NoNullAllowedException(Resources.PlLinesToWaternetConverter_NoSoilProfile1dDefined); + throw new NoNullAllowedException(Resources.PlLinesToWaternetConverter_NoSoilProfileDefined); } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx =================================================================== diff -u -r2575 -r2981 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 2575) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 2981) @@ -297,8 +297,8 @@ No soil profiles available for location '{0}' - - No 1D soil profile defined + + No soil profile defined No pl-lines object defined Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx =================================================================== diff -u -r2575 -r2981 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 2575) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 2981) @@ -297,8 +297,8 @@ Geen object voor pn-lijnen gedefinieerd - - Geen 1D ondergrond profiel gedefinieerd + + Geen ondergrond profiel gedefinieerd Geen segmenten met faalmechanisme {0} aanwezig Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs =================================================================== diff -u -r2575 -r2981 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2575) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2981) @@ -19,7 +19,7 @@ // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -136,6 +136,15 @@ } /// + /// Looks up a localized string similar to Required safety factor must be specified. + /// + internal static string DamMacroStabilityOutwardsKernelWrapper_Prepare_NoRequiredSafetyFactor { + get { + return ResourceManager.GetString("DamMacroStabilityOutwardsKernelWrapper_Prepare_NoRequiredSafetyFactor", resourceCulture); + } + } + + /// /// Looks up a localized string similar to No Dam input object defined for Bligh. /// internal static string DamPipingBlighKernelWrapper_NoDamInputObjectDefinedForBligh { @@ -425,11 +434,11 @@ } /// - /// Looks up a localized string similar to No 1D soil profile defined. + /// Looks up a localized string similar to No soil profile defined. /// - internal static string PlLinesToWaternetConverter_NoSoilProfile1dDefined { + internal static string PlLinesToWaternetConverter_NoSoilProfileDefined { get { - return ResourceManager.GetString("PlLinesToWaternetConverter_NoSoilProfile1dDefined", resourceCulture); + return ResourceManager.GetString("PlLinesToWaternetConverter_NoSoilProfileDefined", resourceCulture); } } Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverterTests.cs =================================================================== diff -u -r2980 -r2981 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverterTests.cs (.../PlLinesToWaternetConverterTests.cs) (revision 2980) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverterTests.cs (.../PlLinesToWaternetConverterTests.cs) (revision 2981) @@ -1258,12 +1258,12 @@ } [Test] - [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen 1D ondergrond profiel gedefinieerd")] + [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen ondergrond profiel gedefinieerd")] [SetUICulture("nl-NL")] public void TestLanguageNLThrowsExceptionWhenSoilProfile1DIsNull() { var plLines = new PlLines(); - PlLinesToWaternetConverter.ConvertPlLineToWaternet(plLines,(SoilProfile1D) null, 0, 0, 0); + PlLinesToWaternetConverter.ConvertPlLineToWaternet(plLines,null, 0, 0, 0); } [Test] @@ -1275,6 +1275,26 @@ PlLinesToWaternetConverter.ConvertPlLineToWaternet(null, soilProfile1D, 0, 0, 0); } + + [Test] + [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen ondergrond profiel gedefinieerd")] + [SetUICulture("nl-NL")] + public void ConvertPlLineToWaternet_SoilProfileNull_ThrowsException() + { + var plLines = new PlLines(); + PlLinesToWaternetConverter.ConvertPlLineToWaternet(plLines, null, 0); + } + + [Test] + [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen object voor pn-lijnen gedefinieerd")] + [SetUICulture("nl-NL")] + public void ConvertPlLineToWaternet_ProfileLinesNull_ThrowsException() + { + var soilProfile = new SoilProfile2D(); + PlLinesToWaternetConverter.ConvertPlLineToWaternet(null, soilProfile, 0); + } + + private PlLines CreatePlLinesForTest() { var plLines = new PlLines();