Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs =================================================================== diff -u -rc37f276833a0c2638b9514f528f3434c8d68199c -r3ff98dbb4db7f1269de33c3e972a633ec74169a5 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs (.../TestCalculationWithForeshoreProfile.cs) (revision c37f276833a0c2638b9514f528f3434c8d68199c) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestCalculationWithForeshoreProfile.cs (.../TestCalculationWithForeshoreProfile.cs) (revision 3ff98dbb4db7f1269de33c3e972a633ec74169a5) @@ -41,7 +41,9 @@ } public string Name { get; set; } + public bool HasOutput { get; private set; } + public Comment Comments { get; } /// @@ -106,6 +108,7 @@ public class TestCalculationInputWithForeshoreProfile : ICalculationInput, IUseForeshore, IHasForeshoreProfile { public ForeshoreProfile ForeshoreProfile { get; set; } + public bool IsForeshoreProfileInputSynchronized { get; } public bool UseForeshore { get; set; } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ForeshoreProfileUpdateDataStrategy.cs =================================================================== diff -u -rc37f276833a0c2638b9514f528f3434c8d68199c -r3ff98dbb4db7f1269de33c3e972a633ec74169a5 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ForeshoreProfileUpdateDataStrategy.cs (.../ForeshoreProfileUpdateDataStrategy.cs) (revision c37f276833a0c2638b9514f528f3434c8d68199c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ForeshoreProfileUpdateDataStrategy.cs (.../ForeshoreProfileUpdateDataStrategy.cs) (revision 3ff98dbb4db7f1269de33c3e972a633ec74169a5) @@ -71,6 +71,28 @@ return affectedObjects; } + protected override IEnumerable UpdateObjectAndDependentData(ForeshoreProfile objectToUpdate, ForeshoreProfile objectToUpdateFrom) + { + objectToUpdate.CopyProperties(objectToUpdateFrom); + + var affectedObjects = new List(); + + IEnumerable> affectedCalculations = GetAffectedCalculationWithSurfaceLines(objectToUpdate); + + foreach (ICalculation calculation in affectedCalculations) + { + affectedObjects.Add(calculation.InputParameters); + affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(calculation)); + + if (!objectToUpdate.Geometry.Any()) + { + ((IUseForeshore) calculation.InputParameters).UseForeshore = false; + } + } + + return affectedObjects; + } + private IEnumerable> GetAffectedCalculationWithSurfaceLines(ForeshoreProfile foreshoreProfile) { IEnumerable> calculations = FailureMechanism.Calculations.Cast>(); @@ -95,36 +117,5 @@ return obj.Id.GetHashCode(); } } - - #region Update Logic - - protected override IEnumerable UpdateObjectAndDependentData(ForeshoreProfile objectToUpdate, ForeshoreProfile objectToUpdateFrom) - { - objectToUpdate.CopyProperties(objectToUpdateFrom); - - var affectedObjects = new List(); - - IEnumerable> affectedCalculations = GetAffectedCalculationWithSurfaceLines(objectToUpdate); - - foreach (ICalculation calculation in affectedCalculations) - { - affectedObjects.Add(calculation.InputParameters); - affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(calculation)); - - ValidateUseForeshore(calculation, objectToUpdate); - } - - return affectedObjects; - } - - private static void ValidateUseForeshore(ICalculation calculation, ForeshoreProfile foreshoreProfile) - { - if (!foreshoreProfile.Geometry.Any()) - { - ((IUseForeshore) calculation.InputParameters).UseForeshore = false; - } - } - - #endregion } } \ No newline at end of file