Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/MacroStabilityInwardsSoilCreatorTest.cs =================================================================== diff -u -r0ecc2eb11789b230484e87fd6109bc61dc8d9b2d -r95843fdfddefff162cfec2151e4e7bbf4f7283e5 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/MacroStabilityInwardsSoilCreatorTest.cs (.../MacroStabilityInwardsSoilCreatorTest.cs) (revision 0ecc2eb11789b230484e87fd6109bc61dc8d9b2d) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Creators/MacroStabilityInwardsSoilCreatorTest.cs (.../MacroStabilityInwardsSoilCreatorTest.cs) (revision 95843fdfddefff162cfec2151e4e7bbf4f7283e5) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.ComponentModel; using System.Linq; using Core.Common.TestUtil; using Deltares.WTIStability.Data.Geo; @@ -68,17 +69,6 @@ }, new TestMacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine( new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine.ConstructionProperties { - UsePop = false, - ShearStrengthModel = MacroStabilityInwardsShearStrengthModel.None, - MaterialName = "Mud" - })), - new MacroStabilityInwardsSoilLayerUnderSurfaceLine(new[] - { - new Point2D(0, 0), - new Point2D(1, 1) - }, new TestMacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine( - new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine.ConstructionProperties - { UsePop = true, ShearStrengthModel = MacroStabilityInwardsShearStrengthModel.CPhiOrSuCalculated, MaterialName = "Clay" @@ -100,14 +90,13 @@ Soil[] soils = MacroStabilityInwardsSoilCreator.Create(profile); // Assert - Assert.AreEqual(4, soils.Length); + Assert.AreEqual(3, soils.Length); CollectionAssert.AreEqual(profile.LayersUnderSurfaceLine.Select(l => l.Properties.UsePop), soils.Select(s => s.UsePop)); CollectionAssert.AreEqual(profile.LayersUnderSurfaceLine.Select(l => l.Properties.MaterialName), soils.Select(s => s.Name)); CollectionAssert.AreEqual(new[] { ShearStrengthModel.CPhi, - ShearStrengthModel.None, ShearStrengthModel.CPhiOrCuCalculated, ShearStrengthModel.CuCalculated }, soils.Select(s => s.ShearStrengthModel)); @@ -121,7 +110,7 @@ } [Test] - public void Create_InvalidShearStrengthModel_ThrowNotSupportedException() + public void Create_InvalidShearStrengthModel_ThrowInvalidEnumArgumentException() { // Setup var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine(new[] @@ -140,6 +129,30 @@ TestDelegate test = () => MacroStabilityInwardsSoilCreator.Create(profile); // Assert + string message = $"The value of argument 'shearStrengthModel' ({99}) is invalid for Enum type '{typeof(MacroStabilityInwardsShearStrengthModel).Name}'."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message); + } + + [Test] + public void Create_UnsupportedShearStrengthModel_ThrowNotSupportedException() + { + // Setup + var profile = new MacroStabilityInwardsSoilProfileUnderSurfaceLine(new[] + { + new MacroStabilityInwardsSoilLayerUnderSurfaceLine(new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + }, new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine(new MacroStabilityInwardsSoilLayerPropertiesUnderSurfaceLine.ConstructionProperties + { + ShearStrengthModel = MacroStabilityInwardsShearStrengthModel.None + })) + }); + + // Call + TestDelegate test = () => MacroStabilityInwardsSoilCreator.Create(profile); + + // Assert Assert.Throws(test); }