Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs =================================================================== diff -u -re6136967285d64c823a38b828f710b74f2a3dba9 -r21c5f61cf3ed838f68ab432067404a6de05b8ef2 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision e6136967285d64c823a38b828f710b74f2a3dba9) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision 21c5f61cf3ed838f68ab432067404a6de05b8ef2) @@ -248,6 +248,41 @@ } [Test] + [TestCaseSource(typeof(MapViewTestHelper), nameof(MapViewTestHelper.GetCalculationFuncs))] + public void GivenViewWithHydraulicBoundaryLocationsData_WhenHydraulicBoundaryLocationCalculationUpdatedAndNotified_ThenMapDataUpdated( + Func getCalculationFunc) + { + // Given + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.AddHydraulicBoundaryLocation(hydraulicBoundaryLocation); + + using (var view = new HeightStructuresFailureMechanismView(new HeightStructuresFailureMechanism(), assessmentSection)) + { + IMapControl map = ((RingtoetsMapControl)view.Controls[0]).MapControl; + + var mocks = new MockRepository(); + IObserver[] observers = AttachMapDataObservers(mocks, map.Data.Collection); + observers[hydraulicBoundaryLocationsIndex].Expect(obs => obs.UpdateObserver()); + mocks.ReplayAll(); + + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + + // Precondition + MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection, hydraulicBoundaryLocationsMapData); + + // When + HydraulicBoundaryLocationCalculation calculation = getCalculationFunc(assessmentSection); + calculation.Output = new TestHydraulicBoundaryLocationOutput(new Random(21).NextDouble()); + calculation.NotifyObservers(); + + // Then + MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection, hydraulicBoundaryLocationsMapData); + mocks.VerifyAll(); + } + } + + [Test] public void GivenViewWithHydraulicBoundaryLocationsData_WhenLocationUpdatedAndNotified_ThenMapDataUpdated() { // Given