Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs =================================================================== diff -u -r4823cb59d1ccc0d69505cd6ff10acfb6c5c2488a -red456b64612970e1ef09e2a876bbb35754443d6d --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision 4823cb59d1ccc0d69505cd6ff10acfb6c5c2488a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision ed456b64612970e1ef09e2a876bbb35754443d6d) @@ -51,7 +51,6 @@ private readonly RecursiveObserver, HydraulicBoundaryLocationCalculation> waveHeightCalculationsForSignalingNormObserver; private readonly RecursiveObserver, HydraulicBoundaryLocationCalculation> waveHeightCalculationsForLowerLimitNormObserver; private readonly RecursiveObserver, HydraulicBoundaryLocationCalculation> waveHeightCalculationsForFactorizedLowerLimitNormObserver; - private readonly RecursiveObserver, HydraulicBoundaryLocation> hydraulicBoundaryLocationObserver; /// /// Creates a new instance of . @@ -83,11 +82,6 @@ { Observable = assessmentSection.HydraulicBoundaryDatabase.Locations }; - hydraulicBoundaryLocationObserver = new RecursiveObserver, HydraulicBoundaryLocation>( - UpdateMapData, hbl => hbl) - { - Observable = assessmentSection.HydraulicBoundaryDatabase.Locations - }; var mapDataCollection = new MapDataCollection(Resources.AssessmentSectionMap_DisplayName); referenceLineMapData = RingtoetsMapDataFactory.CreateReferenceLineMapData(); @@ -102,16 +96,6 @@ ringtoetsMapControl.SetAllData(mapDataCollection, assessmentSection.BackgroundData); } - private RecursiveObserver, HydraulicBoundaryLocationCalculation> CreateHydraulicBoundaryLocationCalculationsObserver( - IObservableEnumerable calculations) - { - return new RecursiveObserver, HydraulicBoundaryLocationCalculation>( - UpdateMapData, calc => calc) - { - Observable = calculations - }; - } - public object Data { get; set; } public IMapControl Map @@ -134,7 +118,6 @@ waveHeightCalculationsForLowerLimitNormObserver.Dispose(); waveHeightCalculationsForFactorizedLowerLimitNormObserver.Dispose(); hydraulicBoundaryLocationsObserver.Dispose(); - hydraulicBoundaryLocationObserver.Dispose(); if (disposing) { @@ -144,6 +127,16 @@ base.Dispose(disposing); } + private RecursiveObserver, HydraulicBoundaryLocationCalculation> CreateHydraulicBoundaryLocationCalculationsObserver( + IObservableEnumerable calculations) + { + return new RecursiveObserver, HydraulicBoundaryLocationCalculation>( + UpdateMapData, calc => calc) + { + Observable = calculations + }; + } + private void UpdateMapData() { SetMapDataFeatures(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs =================================================================== diff -u -r4823cb59d1ccc0d69505cd6ff10acfb6c5c2488a -red456b64612970e1ef09e2a876bbb35754443d6d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 4823cb59d1ccc0d69505cd6ff10acfb6c5c2488a) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision ed456b64612970e1ef09e2a876bbb35754443d6d) @@ -147,40 +147,6 @@ } [Test] - public void GivenViewWithHydraulicBoundaryLocationsData_WhenLocationUpdatedAndNotified_ThenMapDataUpdated() - { - // Given - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0); - var assessmentSection = new ObservableTestAssessmentSectionStub(); - assessmentSection.AddHydraulicBoundaryLocation(hydraulicBoundaryLocation); - - using (var view = new AssessmentSectionView(assessmentSection)) - { - IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - - MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); - - // Precondition - MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection, hydraulicBoundaryLocationsMapData); - - // When - var random = new Random(21); - assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.First().Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); - assessmentSection.WaterLevelCalculationsForSignalingNorm.First().Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); - assessmentSection.WaterLevelCalculationsForLowerLimitNorm.First().Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); - assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.First().Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); - assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm.First().Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); - assessmentSection.WaveHeightCalculationsForSignalingNorm.First().Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); - assessmentSection.WaveHeightCalculationsForLowerLimitNorm.First().Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); - assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm.First().Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); - hydraulicBoundaryLocation.NotifyObservers(); - - // Then - MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection, hydraulicBoundaryLocationsMapData); - } - } - - [Test] [TestCaseSource(nameof(GetCalculationFuncs))] public void GivenViewWithHydraulicBoundaryLocationsData_WhenHydraulicBoundaryLocationCalculationUpdatedAndNotified_ThenMapDataUpdated( Func getCalculationFunc) @@ -307,12 +273,10 @@ var hrLocationsMapData = (MapPointData) mapData.Collection.ElementAt(hydraulicBoundaryLocationsIndex - 1); Assert.AreEqual("Hydraulische randvoorwaarden", hrLocationsMapData.Name); + // Call assessmentSection.AddHydraulicBoundaryLocation(new HydraulicBoundaryLocation(2, "new 2", 2, 3)); assessmentSection.HydraulicBoundaryDatabase.Locations.NotifyObservers(); - // Call - assessmentSection.NotifyObservers(); - // Assert var actualReferenceLineMapData = (MapLineData) mapData.Collection.ElementAt(referenceLineIndex + 1); Assert.AreEqual("Referentielijn", actualReferenceLineMapData.Name);