Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs =================================================================== diff -u -r47b2bbe8b9d15194a9641a2db098c25e5e775528 -r7472a3a034f5d43d665980b35727c63d167abb5e --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs (.../MacroStabilityInwardsGridTest.cs) (revision 47b2bbe8b9d15194a9641a2db098c25e5e775528) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsGridTest.cs (.../MacroStabilityInwardsGridTest.cs) (revision 7472a3a034f5d43d665980b35727c63d167abb5e) @@ -22,7 +22,6 @@ 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; @@ -36,7 +35,7 @@ public void Constructor_ExpectedValues() { // Call - var grid = new MacroStabilityInwardsGrid(); + var grid = new MacroStabilityInwardsGrid(double.NaN, double.NaN, double.NaN, double.NaN); // Assert Assert.IsInstanceOf(grid); @@ -63,17 +62,21 @@ // Setup var random = new Random(21); double xLeft = random.NextDouble(); - double xRight = random.NextDouble(); - double zTop = random.NextDouble(); + double xRight = 1 + random.NextDouble(); + double zTop = 1 + random.NextDouble(); double zBottom = random.NextDouble(); + int numberOfHorizontalPoints = random.Next(1, 100); + int numberOfVerticalPoints = random.Next(1, 100); // call - var grid = new MacroStabilityInwardsGrid + var grid = new MacroStabilityInwardsGrid(double.NaN, double.NaN, double.NaN, double.NaN) { XLeft = (RoundedDouble) xLeft, XRight = (RoundedDouble) xRight, ZTop = (RoundedDouble) zTop, - ZBottom = (RoundedDouble) zBottom + ZBottom = (RoundedDouble) zBottom, + NumberOfHorizontalPoints = numberOfHorizontalPoints, + NumberOfVerticalPoints = numberOfVerticalPoints }; // Assert @@ -92,21 +95,23 @@ Assert.AreEqual(2, grid.ZBottom.NumberOfDecimalPlaces); Assert.AreEqual(zBottom, grid.ZBottom, grid.ZBottom.GetAccuracy()); + + Assert.AreEqual(numberOfHorizontalPoints, grid.NumberOfHorizontalPoints); + Assert.AreEqual(numberOfVerticalPoints, grid.NumberOfVerticalPoints); } [Test] public void Clone_Always_ReturnNewInstanceWithCopiedValues() { // Setup var random = new Random(21); - var original = new MacroStabilityInwardsGrid + var original = new MacroStabilityInwardsGrid(random.NextDouble(), + 1 + random.NextDouble(), + 1 + random.NextDouble(), + random.NextDouble()) { - XLeft = random.NextRoundedDouble(), - XRight = random.NextRoundedDouble(), - NumberOfHorizontalPoints = random.Next(), - ZTop = random.NextRoundedDouble(), - ZBottom = random.NextRoundedDouble(), - NumberOfVerticalPoints = random.Next() + NumberOfHorizontalPoints = random.Next(1, 100), + NumberOfVerticalPoints = random.Next(1, 100) }; // Call