Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs
===================================================================
diff -u -re77815b31b213789da306754de0867d6cb2de105 -rde2931de5e3ccab7c7d127723b6a3be373518131
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs (.../WaternetCalculationService.cs) (revision e77815b31b213789da306754de0867d6cb2de105)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/WaternetCalculationService.cs (.../WaternetCalculationService.cs) (revision de2931de5e3ccab7c7d127723b6a3be373518131)
@@ -49,7 +49,8 @@
/// could not be calculated.
/// Thrown when
/// is null.
- public static MacroStabilityInwardsWaternet CalculateExtreme(IMacroStabilityInwardsWaternetInput input, RoundedDouble assessmentLevel)
+ public static MacroStabilityInwardsWaternet CalculateExtreme(IMacroStabilityInwardsWaternetInput input,
+ RoundedDouble assessmentLevel)
{
if (input == null)
{
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/WaternetCalculationServiceTest.cs
===================================================================
diff -u -r5c7faf8283e49113a2c7b9e17086148a99f13d2e -rde2931de5e3ccab7c7d127723b6a3be373518131
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/WaternetCalculationServiceTest.cs (.../WaternetCalculationServiceTest.cs) (revision 5c7faf8283e49113a2c7b9e17086148a99f13d2e)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.CalculatedInput.Test/WaternetCalculationServiceTest.cs (.../WaternetCalculationServiceTest.cs) (revision de2931de5e3ccab7c7d127723b6a3be373518131)
@@ -20,6 +20,8 @@
// All rights reserved.
using System;
+using Core.Common.Base.Data;
+using Core.Common.TestUtil;
using NUnit.Framework;
using Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil;
using Ringtoets.MacroStabilityInwards.Data;
@@ -47,7 +49,7 @@
public void CalculateExtreme_InputNull_ThrowsArgumentNullException()
{
// Call
- TestDelegate call = () => WaternetCalculationService.CalculateExtreme(null);
+ TestDelegate call = () => WaternetCalculationService.CalculateExtreme(null, RoundedDouble.NaN);
// Assert
var exception = Assert.Throws(call);
@@ -58,12 +60,13 @@
public void CalculateExtreme_WithInput_SetsInputOnCalculator()
{
// Setup
+ RoundedDouble assessmentLevel = new Random(21).NextRoundedDouble();
MacroStabilityInwardsInput input = testCalculation.InputParameters;
using (new MacroStabilityInwardsCalculatorFactoryConfig())
{
// Call
- WaternetCalculationService.CalculateExtreme(input);
+ WaternetCalculationService.CalculateExtreme(input, assessmentLevel);
// Assert
var factory = (TestMacroStabilityInwardsCalculatorFactory) MacroStabilityInwardsCalculatorFactory.Instance;
@@ -72,7 +75,7 @@
CalculatorInputAssert.AssertPhreaticLineOffsets(input.LocationInputExtreme, actualInput.PhreaticLineOffsets);
Assert.AreEqual(input.LocationInputExtreme.WaterLevelPolder, actualInput.WaterLevelPolder);
Assert.AreEqual(input.LocationInputExtreme.PenetrationLength, actualInput.PenetrationLength);
- Assert.AreEqual(input.AssessmentLevel, actualInput.AssessmentLevel);
+ Assert.AreEqual(assessmentLevel, actualInput.AssessmentLevel);
AssertGenericInput(input, actualInput);
}
@@ -87,7 +90,7 @@
var calculatorFactory = (TestMacroStabilityInwardsCalculatorFactory) MacroStabilityInwardsCalculatorFactory.Instance;
// Call
- MacroStabilityInwardsWaternet output = WaternetCalculationService.CalculateExtreme(testCalculation.InputParameters);
+ MacroStabilityInwardsWaternet output = WaternetCalculationService.CalculateExtreme(testCalculation.InputParameters, RoundedDouble.NaN);
// Assert
CalculatorOutputAssert.AssertWaternet(calculatorFactory.LastCreatedWaternetCalculator.Output, output);
@@ -104,7 +107,7 @@
calculatorFactory.LastCreatedWaternetCalculator.ThrowExceptionOnCalculate = true;
// Call
- MacroStabilityInwardsWaternet output = WaternetCalculationService.CalculateExtreme(testCalculation.InputParameters);
+ MacroStabilityInwardsWaternet output = WaternetCalculationService.CalculateExtreme(testCalculation.InputParameters, RoundedDouble.NaN);
// Assert
Assert.IsNotNull(output);