Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationContext.cs
===================================================================
diff -u -r24942d5d831cb0d67336dd9d5506a4a23cf099f5 -re649822ccb64af259adda08b8aa096bf08bf1a87
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationContext.cs (.../DesignWaterLevelLocationContext.cs) (revision 24942d5d831cb0d67336dd9d5506a4a23cf099f5)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationContext.cs (.../DesignWaterLevelLocationContext.cs) (revision e649822ccb64af259adda08b8aa096bf08bf1a87)
@@ -33,11 +33,13 @@
///
/// Creates a new instance of .
///
- /// The
- /// which the belongs to.
- /// Thrown when
- /// is null.
- public DesignWaterLevelLocationContext(HydraulicBoundaryLocation wrappedData)
- : base(wrappedData) {}
+ /// The which the
+ /// belongs to.
+ /// for obtaining a
+ /// based on .
+ /// Thrown when any input parameter is null.
+ public DesignWaterLevelLocationContext(HydraulicBoundaryLocation wrappedData,
+ Func getCalculationFunc)
+ : base(wrappedData, getCalculationFunc) {}
}
}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationContext.cs
===================================================================
diff -u -r24942d5d831cb0d67336dd9d5506a4a23cf099f5 -re649822ccb64af259adda08b8aa096bf08bf1a87
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationContext.cs (.../WaveHeightLocationContext.cs) (revision 24942d5d831cb0d67336dd9d5506a4a23cf099f5)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationContext.cs (.../WaveHeightLocationContext.cs) (revision e649822ccb64af259adda08b8aa096bf08bf1a87)
@@ -33,10 +33,13 @@
///
/// Creates a new instance of .
///
- /// The which the belongs to.
- /// Thrown when
- /// is null.
- public WaveHeightLocationContext(HydraulicBoundaryLocation hydraulicBoundaryLocation)
- : base(hydraulicBoundaryLocation) {}
+ /// The which the
+ /// belongs to.
+ /// for obtaining a
+ /// based on .
+ /// Thrown when any input parameter is null.
+ public WaveHeightLocationContext(HydraulicBoundaryLocation hydraulicBoundaryLocation,
+ Func getCalculationFunc)
+ : base(hydraulicBoundaryLocation, getCalculationFunc) {}
}
}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs
===================================================================
diff -u -r7594f72cabeb4802ffab5715e2edb2712fc1f0df -re649822ccb64af259adda08b8aa096bf08bf1a87
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs (.../DesignWaterLevelLocationContextTest.cs) (revision 7594f72cabeb4802ffab5715e2edb2712fc1f0df)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs (.../DesignWaterLevelLocationContextTest.cs) (revision e649822ccb64af259adda08b8aa096bf08bf1a87)
@@ -30,48 +30,19 @@
public class DesignWaterLevelLocationContextTest
{
[Test]
- public void Constructor_NullHydraulicBoundaryLocation_ThrowsArgumentNullException()
- {
- // Setup
- var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase();
-
- // Call
- TestDelegate test = () => new DesignWaterLevelLocationContext(null, hydraulicBoundaryDatabase);
-
- // Assert
- string paramName = Assert.Throws(test).ParamName;
- Assert.AreEqual("wrappedData", paramName);
- }
-
- [Test]
- public void Constructor_NullHydraulicBoundariesDatabase_ThrowsArgumentNullException()
- {
- // Setup
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0);
-
- // Call
- TestDelegate test = () => new DesignWaterLevelLocationContext(hydraulicBoundaryLocation, null);
-
- // Assert
- string paramName = Assert.Throws(test).ParamName;
- Assert.AreEqual("hydraulicBoundaryDatabase", paramName);
- }
-
- [Test]
public void Constructor_ValidParameters_ExpectedValues()
{
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0);
- var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase();
- hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation);
+ Func getCalculationFunc = hbl => null;
// Call
- var presentationObject = new DesignWaterLevelLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase);
+ var presentationObject = new DesignWaterLevelLocationContext(hydraulicBoundaryLocation, getCalculationFunc);
// Assert
Assert.IsInstanceOf(presentationObject);
- Assert.AreSame(hydraulicBoundaryDatabase, presentationObject.HydraulicBoundaryDatabase);
Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData);
+ Assert.AreSame(getCalculationFunc, presentationObject.GetCalculationFunc);
}
}
}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs
===================================================================
diff -u -r75d12c89224759df39acf21f187f309a3e4ae274 -re649822ccb64af259adda08b8aa096bf08bf1a87
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs (.../WaveHeightLocationContextTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs (.../WaveHeightLocationContextTest.cs) (revision e649822ccb64af259adda08b8aa096bf08bf1a87)
@@ -30,28 +30,19 @@
public class WaveHeightLocationContextTest
{
[Test]
- public void Constructor_NullHydraulicBoundaryLocation_ThrowsArgumentNullException()
- {
- // Call
- TestDelegate test = () => new WaveHeightLocationContext(null);
-
- // Assert
- string paramName = Assert.Throws(test).ParamName;
- Assert.AreEqual("wrappedData", paramName);
- }
-
- [Test]
public void Constructor_ValidParameters_ExpectedValues()
{
// Setup
var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0);
+ Func getCalculationFunc = hbl => null;
// Call
- var presentationObject = new WaveHeightLocationContext(hydraulicBoundaryLocation);
+ var presentationObject = new WaveHeightLocationContext(hydraulicBoundaryLocation, getCalculationFunc);
// Assert
Assert.IsInstanceOf(presentationObject);
Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData);
+ Assert.AreSame(getCalculationFunc, presentationObject.GetCalculationFunc);
}
}
}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj
===================================================================
diff -u -rea24362eecb0eb22d279899db504a3f76e17795c -re649822ccb64af259adda08b8aa096bf08bf1a87
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision ea24362eecb0eb22d279899db504a3f76e17795c)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision e649822ccb64af259adda08b8aa096bf08bf1a87)
@@ -37,6 +37,7 @@
+