Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -r031324e6fd6fc8555d672b234378ac6a149fcb35 -r649ed9247c8dfe31cace4cf41095c0befa7de517 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 031324e6fd6fc8555d672b234378ac6a149fcb35) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 649ed9247c8dfe31cace4cf41095c0befa7de517) @@ -196,15 +196,9 @@ var assessmentSection = new ObservableTestAssessmentSectionStub { - HydraulicBoundaryDatabase = - { - Locations = - { - new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) - } - }, ReferenceLine = referenceLine }; + assessmentSection.AddHydraulicBoundaryLocation(new HydraulicBoundaryLocation(1, "test", 1.0, 2.0)); // Call using (var view = new PipingFailureMechanismView(failureMechanism, assessmentSection)) @@ -232,16 +226,8 @@ public void GivenViewWithHydraulicBoundaryLocationsData_WhenHydraulicBoundaryLocationsUpdatedAndNotified_ThenMapDataUpdated() { // Given - var assessmentSection = new ObservableTestAssessmentSectionStub - { - HydraulicBoundaryDatabase = - { - Locations = - { - new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0) - } - } - }; + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.AddHydraulicBoundaryLocation(new HydraulicBoundaryLocation(1, "test", 1.0, 2.0)); using (var view = new PipingFailureMechanismView(new PipingFailureMechanism(), assessmentSection)) { @@ -258,7 +244,7 @@ MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection.HydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); // When - assessmentSection.HydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(2, "test2", 2.0, 3.0)); + assessmentSection.AddHydraulicBoundaryLocation(new HydraulicBoundaryLocation(2, "test2", 2.0, 3.0)); assessmentSection.HydraulicBoundaryDatabase.Locations.NotifyObservers(); // Then @@ -273,16 +259,8 @@ // Given var random = new Random(21); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0); - var assessmentSection = new ObservableTestAssessmentSectionStub - { - HydraulicBoundaryDatabase = - { - Locations = - { - hydraulicBoundaryLocation - } - } - }; + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.AddHydraulicBoundaryLocation(hydraulicBoundaryLocation); using (var view = new PipingFailureMechanismView(new PipingFailureMechanism(), assessmentSection)) { @@ -291,8 +269,7 @@ MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition - MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection.HydraulicBoundaryDatabase.Locations, - hydraulicBoundaryLocationsMapData); + MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection, hydraulicBoundaryLocationsMapData); // When hydraulicBoundaryLocation.DesignWaterLevelCalculation1.Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()); @@ -306,8 +283,7 @@ hydraulicBoundaryLocation.NotifyObservers(); // Then - MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection.HydraulicBoundaryDatabase.Locations, - hydraulicBoundaryLocationsMapData); + MapDataTestHelper.AssertHydraulicBoundaryLocationOutputsMapData(assessmentSection, hydraulicBoundaryLocationsMapData); } }