Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs =================================================================== diff -u -r4865c9f054759a07acd949f86d879fbb7998fd20 -ra991726f9b6dfab076b5c8274e605619b1333f22 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision 4865c9f054759a07acd949f86d879fbb7998fd20) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision a991726f9b6dfab076b5c8274e605619b1333f22) @@ -211,8 +211,6 @@ hydraulicBoundaryLocation }; - TestHydraulicBoundaryLocationsView view = ShowTestHydraulicBoundaryLocationsView(locations); - var topLevelIllustrationPoints = new[] { new TopLevelSubMechanismIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection(), @@ -227,8 +225,9 @@ { Output = output }; - view.ItemToCreate = calculation; + TestHydraulicBoundaryLocationsView view = ShowTestHydraulicBoundaryLocationsView(locations, hbl => calculation); + // Call IEnumerable actualControlItems = view.PublicGetIllustrationPointControlItems(); @@ -259,13 +258,15 @@ private void ShowTestHydraulicBoundaryLocationsView() { - ShowTestHydraulicBoundaryLocationsView(new ObservableList()); + ShowTestHydraulicBoundaryLocationsView(new ObservableList(), + hbl => new HydraulicBoundaryLocationCalculation()); } - private TestHydraulicBoundaryLocationsView ShowTestHydraulicBoundaryLocationsView(ObservableList locations) + private TestHydraulicBoundaryLocationsView ShowTestHydraulicBoundaryLocationsView(ObservableList locations, + Func getCalculationFunc) { var view = new TestHydraulicBoundaryLocationsView(locations, - hbl => new HydraulicBoundaryLocationCalculation(), + getCalculationFunc, new ObservableTestAssessmentSectionStub()); testForm.Controls.Add(view); @@ -306,7 +307,8 @@ } }); - return ShowTestHydraulicBoundaryLocationsView(locations); + return ShowTestHydraulicBoundaryLocationsView(locations, + hbl => hbl.WaveHeightCalculation1); } private sealed class TestHydraulicBoundaryLocationsView : HydraulicBoundaryLocationsView @@ -320,8 +322,6 @@ public HydraulicBoundaryLocation GetCalculationsCallArgument { get; private set; } - public HydraulicBoundaryLocationCalculation ItemToCreate { private get; set; } - public IEnumerable PublicGetIllustrationPointControlItems() { return GetIllustrationPointControlItems(); @@ -340,7 +340,8 @@ protected override HydraulicBoundaryLocationCalculation GetCalculation(HydraulicBoundaryLocation location) { GetCalculationsCallArgument = location; - return ItemToCreate ?? location.WaveHeightCalculation1; + + return getCalculationFunc(location); } } }