Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationTest.cs =================================================================== diff -u -r7a7526e4ff1bccf09b09fadcfd309a725c6494b9 -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationTest.cs (.../TestHydraulicBoundaryLocationTest.cs) (revision 7a7526e4ff1bccf09b09fadcfd309a725c6494b9) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationTest.cs (.../TestHydraulicBoundaryLocationTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; @@ -48,54 +47,79 @@ } [Test] - public void CreateDesignWaterLevelCalculated_DesignWaterLevel_ExpectedValues( - [Random(1)] double designWaterLevelValue) + public void CreateDesignWaterLevelCalculated_DesignWaterLevel_ExpectedValues() { // Setup - var designWaterLevel = new RoundedDouble(4, designWaterLevelValue); + const double designWaterLevelValue = 4.5; // Call - HydraulicBoundaryLocation testLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(designWaterLevel); + HydraulicBoundaryLocation testLocation = TestHydraulicBoundaryLocation.CreateDesignWaterLevelCalculated(designWaterLevelValue); // Assert Assert.IsInstanceOf(testLocation); Assert.AreEqual(0, testLocation.Id); Assert.IsEmpty(testLocation.Name); Assert.AreEqual(new Point2D(0, 0), testLocation.Location); - Assert.AreEqual(designWaterLevel, testLocation.DesignWaterLevel, testLocation.DesignWaterLevel.GetAccuracy()); + Assert.AreEqual(designWaterLevelValue, testLocation.DesignWaterLevel, testLocation.DesignWaterLevel.GetAccuracy()); Assert.IsNaN(testLocation.WaveHeight); Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.DesignWaterLevelCalculationConvergence); Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.WaveHeightCalculationConvergence); - var expectedDesignWaterLevelOutput = CreateHydraulicBoundaryLocationOutput(designWaterLevel); + var expectedDesignWaterLevelOutput = CreateHydraulicBoundaryLocationOutput(designWaterLevelValue); AssertAreEqual(expectedDesignWaterLevelOutput, testLocation.DesignWaterLevelOutput); Assert.IsNull(testLocation.WaveHeightOutput); } [Test] - public void CreateWaveHeightCalculated_WaveHeight_ExpectedValues([Random(1)] double waveHeightValue) + public void CreateWaveHeightCalculated_WaveHeight_ExpectedValues() { // Setup - var waveHeight = new RoundedDouble(4, waveHeightValue); + const double waveHeightValue = 5.5; // Call - HydraulicBoundaryLocation testLocation = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(waveHeight); + HydraulicBoundaryLocation testLocation = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(waveHeightValue); // Assert Assert.IsInstanceOf(testLocation); Assert.AreEqual(0, testLocation.Id); Assert.IsEmpty(testLocation.Name); Assert.AreEqual(new Point2D(0, 0), testLocation.Location); Assert.IsNaN(testLocation.DesignWaterLevel); - Assert.AreEqual(waveHeight, testLocation.WaveHeight, testLocation.WaveHeight.GetAccuracy()); + Assert.AreEqual(waveHeightValue, testLocation.WaveHeight, testLocation.WaveHeight.GetAccuracy()); Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.DesignWaterLevelCalculationConvergence); Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.WaveHeightCalculationConvergence); Assert.IsNull(testLocation.DesignWaterLevelOutput); - var expectedWaveHeightOutput = CreateHydraulicBoundaryLocationOutput(waveHeight); + var expectedWaveHeightOutput = CreateHydraulicBoundaryLocationOutput(waveHeightValue); AssertAreEqual(expectedWaveHeightOutput, testLocation.WaveHeightOutput); } + [Test] + public void Constructor_DesignWaterLevelAndWaveHeight_ExpectedValues() + { + // Setup + const double designWaterLevelValue = 4.5; + const double waveHeightValue = 5.5; + + // Call + HydraulicBoundaryLocation testLocation = new TestHydraulicBoundaryLocation(designWaterLevelValue, waveHeightValue); + + // Assert + Assert.IsInstanceOf(testLocation); + Assert.AreEqual(0, testLocation.Id); + Assert.IsEmpty(testLocation.Name); + Assert.AreEqual(new Point2D(0, 0), testLocation.Location); + Assert.AreEqual(designWaterLevelValue, testLocation.DesignWaterLevel, testLocation.DesignWaterLevel.GetAccuracy()); + Assert.AreEqual(waveHeightValue, testLocation.WaveHeight, testLocation.WaveHeight.GetAccuracy()); + Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.DesignWaterLevelCalculationConvergence); + Assert.AreEqual(CalculationConvergence.NotCalculated, testLocation.WaveHeightCalculationConvergence); + + var expectedDesignWaterLevelOutput = CreateHydraulicBoundaryLocationOutput(designWaterLevelValue); + AssertAreEqual(expectedDesignWaterLevelOutput, testLocation.DesignWaterLevelOutput); + var expectedWaveHeightOutput = CreateHydraulicBoundaryLocationOutput(waveHeightValue); + AssertAreEqual(expectedWaveHeightOutput, testLocation.WaveHeightOutput); + } + private static HydraulicBoundaryLocationOutput CreateHydraulicBoundaryLocationOutput(double result) { return new HydraulicBoundaryLocationOutput(result, 0, 0, 0, 0, CalculationConvergence.NotCalculated);