Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs =================================================================== diff -u -rb33f26b930ba074c8ab10eb59fca2cba84f9bdca -r505e67e711e2eaa9486af6c828a41afbd1214046 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision b33f26b930ba074c8ab10eb59fca2cba84f9bdca) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 505e67e711e2eaa9486af6c828a41afbd1214046) @@ -171,7 +171,7 @@ set { surfaceLine = value; - SynchronizeSurfaceLineInput(); + SynchronizeEntryAndExitPoint(); } } @@ -211,35 +211,29 @@ } /// - /// 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. + /// Gets whether the entry and exit point are synchronized with the set . /// - public bool IsSurfaceLineInputSynchronized + /// Always returns false in case no surface line is present. + public bool EntryAndExitPointSynchronized() { - get + if (SurfaceLine == null) { - if (SurfaceLine == null) - { - return false; - } + 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; } /// - /// Applies the properties of the to the - /// parameters of the instance of . + /// Synchronizes the entry and exit point with the parameters of the surface line. /// - /// When no surface line is present, the input parameters are set to default values. - public void SynchronizeSurfaceLineInput() + /// When no surface line is present, the entry and exit point are set to . + public void SynchronizeEntryAndExitPoint() { if (SurfaceLine == null) { @@ -286,7 +280,7 @@ } } - private static void ValidateEntryExitPoint(RoundedDouble entryPointLocalXCoordinate, RoundedDouble exitPointLocalXCoordinate) + private void ValidateEntryExitPoint(RoundedDouble entryPointLocalXCoordinate, RoundedDouble exitPointLocalXCoordinate) { if (entryPointLocalXCoordinate >= exitPointLocalXCoordinate) { Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs =================================================================== diff -u -rb33f26b930ba074c8ab10eb59fca2cba84f9bdca -r505e67e711e2eaa9486af6c828a41afbd1214046 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision b33f26b930ba074c8ab10eb59fca2cba84f9bdca) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 505e67e711e2eaa9486af6c828a41afbd1214046) @@ -823,9 +823,9 @@ private static void UpdateSurfaceLineDependentData(PipingCalculation scenario) { - if (!scenario.InputParameters.IsSurfaceLineInputSynchronized) + if (!scenario.InputParameters.EntryAndExitPointSynchronized()) { - scenario.InputParameters.SynchronizeSurfaceLineInput(); + scenario.InputParameters.SynchronizeEntryAndExitPoint(); var affectedObjects = new List { Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs =================================================================== diff -u -rb33f26b930ba074c8ab10eb59fca2cba84f9bdca -r505e67e711e2eaa9486af6c828a41afbd1214046 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision b33f26b930ba074c8ab10eb59fca2cba84f9bdca) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision 505e67e711e2eaa9486af6c828a41afbd1214046) @@ -40,17 +40,6 @@ [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() { @@ -412,7 +401,7 @@ } [Test] - public void SynchronizeSurfaceLineInput_SurfaceLineNull_EntryPointLAndExitPointLNaN() + public void SynchronizeEntryAndExitPoint_SurfaceLineNull_EntryPointLAndExitPointLNaN() { // Setup var input = new PipingInput(new GeneralPipingInput()) @@ -426,15 +415,15 @@ Assert.AreEqual(5, input.ExitPointL.Value); // Call - input.SynchronizeSurfaceLineInput(); + input.SynchronizeEntryAndExitPoint(); // Assert Assert.IsNaN(input.EntryPointL); Assert.IsNaN(input.ExitPointL); } [Test] - public void SynchronizeSurfaceLineInput_DikeToesBeyondSetExitPointL_ExitPointLAndEntryPointLUpdated() + public void SynchronizeEntryAndExitPoint_DikeToesBeyondSetExitPointL_ExitPointLAndEntryPointLUpdated() { // Setup var input = new PipingInput(new GeneralPipingInput()); @@ -457,15 +446,15 @@ input.ExitPointL = (RoundedDouble) 1; // Call - input.SynchronizeSurfaceLineInput(); + input.SynchronizeEntryAndExitPoint(); // Assert Assert.AreEqual(new RoundedDouble(2, 2), input.EntryPointL); Assert.AreEqual(new RoundedDouble(3, 3), input.ExitPointL); } [Test] - public void SynchronizeSurfaceLineInput_DikeToesBeforeSetEntryPointL_ExitPointLAndEntryPointLUpdated() + public void SynchronizeEntryAndExitPoint_DikeToesBeforeSetEntryPointL_ExitPointLAndEntryPointLUpdated() { // Setup var input = new PipingInput(new GeneralPipingInput()); @@ -488,28 +477,28 @@ input.EntryPointL = (RoundedDouble) 4; // Call - input.SynchronizeSurfaceLineInput(); + input.SynchronizeEntryAndExitPoint(); // Assert Assert.AreEqual(new RoundedDouble(2, 2), input.EntryPointL); Assert.AreEqual(new RoundedDouble(2, 3), input.ExitPointL); } [Test] - public void IsSurfaceLineInputSynchronized_SurfaceLineNull_ReturnFalse() + public void EntryAndExitPointSynchronized_SurfaceLineNull_ReturnFalse() { // Setup var input = new PipingInput(new GeneralPipingInput()); // Call - bool synchronized = input.IsSurfaceLineInputSynchronized; + bool synchronized = input.EntryAndExitPointSynchronized(); // Assert Assert.IsFalse(synchronized); } [Test] - public void IsSurfaceLineInputSynchronized_SurfaceLineAndInputInSync_ReturnTrue() + public void EntryAndExitPointSynchronized_SurfaceLineAndInputInSync_ReturnTrue() { // Setup var surfaceLine = new RingtoetsPipingSurfaceLine(); @@ -531,15 +520,15 @@ }; // Call - bool synchronized = input.IsSurfaceLineInputSynchronized; + bool synchronized = input.EntryAndExitPointSynchronized(); // Assert Assert.IsTrue(synchronized); } [Test] [TestCaseSource(nameof(DifferentSurfaceLineProperties))] - public void IsSurfaceLineInputSynchronized_SurfaceLineAndInputNotInSync_ReturnFalse(Point3D newDikeToeAtRiver, Point3D newDikeToeAtPolder) + public void EntryAndExitPointSynchronized_SurfaceLineAndInputNotInSync_ReturnFalse(Point3D newDikeToeAtRiver, Point3D newDikeToeAtPolder) { // Setup var surfaceLine = new RingtoetsPipingSurfaceLine(); @@ -564,12 +553,23 @@ input.SurfaceLine.SetDikeToeAtPolderAt(newDikeToeAtPolder); // Call - bool synchronized = input.IsSurfaceLineInputSynchronized; + bool synchronized = input.EntryAndExitPointSynchronized(); // 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() {