Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs =================================================================== diff -u -r32ef1a284c06beac64572d830b50f291e390a66d -ra26ca78511abc3f3e04021c203ed484402c3eba4 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs (.../GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs) (revision 32ef1a284c06beac64572d830b50f291e390a66d) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs (.../GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs) (revision a26ca78511abc3f3e04021c203ed484402c3eba4) @@ -630,6 +630,73 @@ Assert.AreSame(affectedCalculation, sectionResults[1].Calculation); } + [Test] + public void UpdateForeshoreProfilesWithImportedData_CalculationWithOutputAndForeshoreProfileUpdatedWithProfileWithoutGeometry_UpdatesCalculation() + { + // Setup + const string id = "profile ID"; + IEnumerable geometry = new[] + { + new Point2D(1, 2), + new Point2D(3, 4) + }; + + var affectedProfile = new TestDikeProfile(geometry, id); + var affectedCalculation = new GrassCoverErosionInwardsCalculation + { + InputParameters = + { + DikeProfile = affectedProfile + }, + Output = new TestGrassCoverErosionInwardsOutput() + }; + affectedCalculation.InputParameters.UseForeshore = true; + + var profileToUpdateFrom = new TestDikeProfile(Enumerable.Empty(), id); + + var dikeProfiles = new DikeProfileCollection(); + var originalDikeProfiles = new[] + { + affectedProfile + }; + dikeProfiles.AddRange(originalDikeProfiles, sourceFilePath); + + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism + { + CalculationsGroup = + { + Children = + { + affectedCalculation + } + } + }; + + var strategy = new GrassCoverErosionInwardsDikeProfileUpdateDataStrategy(failureMechanism); + + // Call + IEnumerable affectedObjects = + strategy.UpdateDikeProfilesWithImportedData(dikeProfiles, + new[] + { + profileToUpdateFrom + }, + sourceFilePath); + + // Assert + Assert.IsFalse(affectedCalculation.HasOutput); + Assert.IsFalse(affectedCalculation.InputParameters.UseForeshore); + AssertDikeProfile(affectedProfile, profileToUpdateFrom); + + CollectionAssert.AreEquivalent(new IObservable[] + { + affectedCalculation, + affectedCalculation.InputParameters, + affectedProfile, + dikeProfiles + }, affectedObjects); + } + /// /// Makes a deep clone of the and modifies /// all its parameters, except the ID.