Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs =================================================================== diff -u -r7472a3a034f5d43d665980b35727c63d167abb5e -r11f07beedffdae5eee71141830eb73827dd3ae94 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs (.../MacroStabilityInwardsGridTest.cs) (revision 7472a3a034f5d43d665980b35727c63d167abb5e) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs (.../MacroStabilityInwardsGridTest.cs) (revision 11f07beedffdae5eee71141830eb73827dd3ae94) @@ -22,6 +22,7 @@ using System; using Core.Common.Base.Data; using Core.Common.Data.TestUtil; +using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.TestUtil; using Ringtoets.MacroStabilityInwards.Data.TestUtil; @@ -52,8 +53,8 @@ Assert.IsNaN(grid.ZBottom); Assert.AreEqual(2, grid.ZBottom.NumberOfDecimalPlaces); - Assert.AreEqual(0, grid.NumberOfHorizontalPoints); - Assert.AreEqual(0, grid.NumberOfVerticalPoints); + Assert.AreEqual(5, grid.NumberOfHorizontalPoints); + Assert.AreEqual(5, grid.NumberOfVerticalPoints); } [Test] @@ -101,6 +102,40 @@ } [Test] + [TestCase(-10)] + [TestCase(0)] + [TestCase(101)] + public void NumberOfHorizontalPoints_NumberOfPointsNotInRange_ThrowsArgumentOutOfRangeException(int numberOfPoints) + { + // Setup + var grid = new MacroStabilityInwardsGrid(double.NaN, double.NaN, double.NaN, double.NaN); + + // Call + TestDelegate call = () => grid.NumberOfHorizontalPoints = numberOfPoints; + + // Assert + const string expectedMessage = "De waarde voor het aantal horizontale punten moet in het bereik [1, 100] liggen."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + } + + [Test] + [TestCase(-10)] + [TestCase(0)] + [TestCase(101)] + public void NumberOfVerticalPoints_NumberOfPointsNotInRange_ThrowsArgumentOutOfRangeException(int numberOfPoints) + { + // Setup + var grid = new MacroStabilityInwardsGrid(double.NaN, double.NaN, double.NaN, double.NaN); + + // Call + TestDelegate call = () => grid.NumberOfVerticalPoints = numberOfPoints; + + // Assert + const string expectedMessage = "De waarde voor het aantal verticale punten moet in het bereik [1, 100] liggen."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + } + + [Test] public void Clone_Always_ReturnNewInstanceWithCopiedValues() { // Setup