Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs
===================================================================
diff -u -r3c0603a8b7245c3daafb7ac23911138db9794449 -rb33f26b930ba074c8ab10eb59fca2cba84f9bdca
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 3c0603a8b7245c3daafb7ac23911138db9794449)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision b33f26b930ba074c8ab10eb59fca2cba84f9bdca)
@@ -171,7 +171,7 @@
set
{
surfaceLine = value;
- SynchronizeEntryAndExitPoint();
+ SynchronizeSurfaceLineInput();
}
}
@@ -211,29 +211,35 @@
}
///
- /// Gets whether the entry and exit point are synchronized with the set .
+ /// Gets the value true if the parameters of the instance of
+ /// that are derived from (entry point and exit point) match the
+ /// properties of ; or false if this is not the case, or if
+ /// there is no assigned.
///
- /// Always returns false in case no surface line is present.
- public bool EntryAndExitPointSynchronized()
+ public bool IsSurfaceLineInputSynchronized
{
- if (SurfaceLine == null)
+ get
{
- return false;
- }
+ if (SurfaceLine == null)
+ {
+ return false;
+ }
- double newEntryPointL;
- double newExitPointL;
- GetEntryExitPointFromSurfaceLine(out newEntryPointL, out newExitPointL);
+ double newEntryPointL;
+ double newExitPointL;
+ GetEntryExitPointFromSurfaceLine(out newEntryPointL, out newExitPointL);
- return Math.Abs(newEntryPointL - EntryPointL) < 1e-6
- && Math.Abs(newExitPointL - ExitPointL) < 1e-6;
+ return Math.Abs(newEntryPointL - EntryPointL) < 1e-6
+ && Math.Abs(newExitPointL - ExitPointL) < 1e-6;
+ }
}
///
- /// Synchronizes the entry and exit point with the parameters of the surface line.
+ /// Applies the properties of the to the
+ /// parameters of the instance of .
///
- /// When no surface line is present, the entry and exit point are set to .
- public void SynchronizeEntryAndExitPoint()
+ /// When no surface line is present, the input parameters are set to default values.
+ public void SynchronizeSurfaceLineInput()
{
if (SurfaceLine == null)
{
@@ -280,7 +286,7 @@
}
}
- private void ValidateEntryExitPoint(RoundedDouble entryPointLocalXCoordinate, RoundedDouble exitPointLocalXCoordinate)
+ private static void ValidateEntryExitPoint(RoundedDouble entryPointLocalXCoordinate, RoundedDouble exitPointLocalXCoordinate)
{
if (entryPointLocalXCoordinate >= exitPointLocalXCoordinate)
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs
===================================================================
diff -u -r842e446f88e513e8be98fa0cf6c111f74d19de6c -rb33f26b930ba074c8ab10eb59fca2cba84f9bdca
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 842e446f88e513e8be98fa0cf6c111f74d19de6c)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision b33f26b930ba074c8ab10eb59fca2cba84f9bdca)
@@ -823,9 +823,9 @@
private static void UpdateSurfaceLineDependentData(PipingCalculation scenario)
{
- if (!scenario.InputParameters.EntryAndExitPointSynchronized())
+ if (!scenario.InputParameters.IsSurfaceLineInputSynchronized)
{
- scenario.InputParameters.SynchronizeEntryAndExitPoint();
+ scenario.InputParameters.SynchronizeSurfaceLineInput();
var affectedObjects = new List
{
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs
===================================================================
diff -u -r3c0603a8b7245c3daafb7ac23911138db9794449 -rb33f26b930ba074c8ab10eb59fca2cba84f9bdca
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision 3c0603a8b7245c3daafb7ac23911138db9794449)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision b33f26b930ba074c8ab10eb59fca2cba84f9bdca)
@@ -40,6 +40,17 @@
[TestFixture]
public class PipingInputTest
{
+ private static IEnumerable DifferentSurfaceLineProperties
+ {
+ get
+ {
+ yield return new TestCaseData(new Point3D(3, 0, 0), new Point3D(3, 0, 0))
+ .SetName("DifferentDikeToeAtRiver");
+ yield return new TestCaseData(new Point3D(2, 0, 3), new Point3D(4, 0, 2))
+ .SetName("DifferentDikeToeAtPolder");
+ }
+ }
+
[Test]
public void Constructor_ExpectedValues()
{
@@ -401,7 +412,7 @@
}
[Test]
- public void SynchronizeEntryAndExitPoint_SurfaceLineNull_EntryPointLAndExitPointLNaN()
+ public void SynchronizeSurfaceLineInput_SurfaceLineNull_EntryPointLAndExitPointLNaN()
{
// Setup
var input = new PipingInput(new GeneralPipingInput())
@@ -415,15 +426,15 @@
Assert.AreEqual(5, input.ExitPointL.Value);
// Call
- input.SynchronizeEntryAndExitPoint();
+ input.SynchronizeSurfaceLineInput();
// Assert
Assert.IsNaN(input.EntryPointL);
Assert.IsNaN(input.ExitPointL);
}
[Test]
- public void SynchronizeEntryAndExitPoint_DikeToesBeyondSetExitPointL_ExitPointLAndEntryPointLUpdated()
+ public void SynchronizeSurfaceLineInput_DikeToesBeyondSetExitPointL_ExitPointLAndEntryPointLUpdated()
{
// Setup
var input = new PipingInput(new GeneralPipingInput());
@@ -446,15 +457,15 @@
input.ExitPointL = (RoundedDouble) 1;
// Call
- input.SynchronizeEntryAndExitPoint();
+ input.SynchronizeSurfaceLineInput();
// Assert
Assert.AreEqual(new RoundedDouble(2, 2), input.EntryPointL);
Assert.AreEqual(new RoundedDouble(3, 3), input.ExitPointL);
}
[Test]
- public void SynchronizeEntryAndExitPoint_DikeToesBeforeSetEntryPointL_ExitPointLAndEntryPointLUpdated()
+ public void SynchronizeSurfaceLineInput_DikeToesBeforeSetEntryPointL_ExitPointLAndEntryPointLUpdated()
{
// Setup
var input = new PipingInput(new GeneralPipingInput());
@@ -477,28 +488,28 @@
input.EntryPointL = (RoundedDouble) 4;
// Call
- input.SynchronizeEntryAndExitPoint();
+ input.SynchronizeSurfaceLineInput();
// Assert
Assert.AreEqual(new RoundedDouble(2, 2), input.EntryPointL);
Assert.AreEqual(new RoundedDouble(2, 3), input.ExitPointL);
}
[Test]
- public void EntryAndExitPointSynchronized_SurfaceLineNull_ReturnFalse()
+ public void IsSurfaceLineInputSynchronized_SurfaceLineNull_ReturnFalse()
{
// Setup
var input = new PipingInput(new GeneralPipingInput());
// Call
- bool synchronized = input.EntryAndExitPointSynchronized();
+ bool synchronized = input.IsSurfaceLineInputSynchronized;
// Assert
Assert.IsFalse(synchronized);
}
[Test]
- public void EntryAndExitPointSynchronized_SurfaceLineAndInputInSync_ReturnTrue()
+ public void IsSurfaceLineInputSynchronized_SurfaceLineAndInputInSync_ReturnTrue()
{
// Setup
var surfaceLine = new RingtoetsPipingSurfaceLine();
@@ -520,15 +531,15 @@
};
// Call
- bool synchronized = input.EntryAndExitPointSynchronized();
+ bool synchronized = input.IsSurfaceLineInputSynchronized;
// Assert
Assert.IsTrue(synchronized);
}
[Test]
[TestCaseSource(nameof(DifferentSurfaceLineProperties))]
- public void EntryAndExitPointSynchronized_SurfaceLineAndInputNotInSync_ReturnFalse(Point3D newDikeToeAtRiver, Point3D newDikeToeAtPolder)
+ public void IsSurfaceLineInputSynchronized_SurfaceLineAndInputNotInSync_ReturnFalse(Point3D newDikeToeAtRiver, Point3D newDikeToeAtPolder)
{
// Setup
var surfaceLine = new RingtoetsPipingSurfaceLine();
@@ -553,23 +564,12 @@
input.SurfaceLine.SetDikeToeAtPolderAt(newDikeToeAtPolder);
// Call
- bool synchronized = input.EntryAndExitPointSynchronized();
+ bool synchronized = input.IsSurfaceLineInputSynchronized;
// Assert
Assert.IsFalse(synchronized);
}
- private static IEnumerable DifferentSurfaceLineProperties
- {
- get
- {
- yield return new TestCaseData(new Point3D(3, 0, 0), new Point3D(3, 0, 0))
- .SetName("DifferentDikeToeAtRiver");
- yield return new TestCaseData(new Point3D(2, 0, 3), new Point3D(4, 0, 2))
- .SetName("DifferentDikeToeAtPolder"); ;
- }
- }
-
[Test]
public void GivenSurfaceLineSet_WhenSurfaceLineNull_ThenEntryAndExitPointsNaN()
{