Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs =================================================================== diff -u -r4521477a959734c2a85c14300de80bf0ee0860b9 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs (.../HydraulicBoundaryLocationsView.cs) (revision 4521477a959734c2a85c14300de80bf0ee0860b9) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs (.../HydraulicBoundaryLocationsView.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -36,8 +36,7 @@ /// Base view for views which should be derived in /// order to get a consistent look and feel. /// - public abstract partial class HydraulicBoundaryLocationsView - : LocationsView + public abstract partial class HydraulicBoundaryLocationsView : LocationsView { private readonly ObservableList locations; @@ -47,11 +46,17 @@ /// /// Creates a new instance of . /// + /// The locations to show in the view. /// The assessment section which the locations belong to. - /// Thrown when - /// is null. - protected HydraulicBoundaryLocationsView(IAssessmentSection assessmentSection) + /// Thrown when or + /// is null. + protected HydraulicBoundaryLocationsView(ObservableList locations, + IAssessmentSection assessmentSection) { + if (locations == null) + { + throw new ArgumentNullException(nameof(locations)); + } if (assessmentSection == null) { throw new ArgumentNullException(nameof(assessmentSection)); @@ -62,7 +67,7 @@ hydraulicBoundaryLocationsObserver = new Observer(UpdateDataGridViewDataSource); hydraulicBoundaryLocationObserver = new RecursiveObserver, HydraulicBoundaryLocation>(HandleHydraulicBoundaryDatabaseUpdate, list => list); - locations = assessmentSection.HydraulicBoundaryDatabase.Locations; + this.locations = locations; hydraulicBoundaryLocationsObserver.Observable = locations; hydraulicBoundaryLocationObserver.Observable = locations; Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs =================================================================== diff -u -rb7267258b1ff8fbdd11cb3a9561eb7d8a71d2935 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision b7267258b1ff8fbdd11cb3a9561eb7d8a71d2935) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -23,10 +23,10 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; +using Core.Common.Base; using Core.Common.Base.Geometry; using NUnit.Extensions.Forms; using NUnit.Framework; -using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.TestUtil; @@ -59,6 +59,17 @@ } [Test] + public void Constructor_LocationsNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new TestHydraulicBoundaryLocationsView(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("locations", exception.ParamName); + } + + [Test] public void Constructor_ExpectedValues() { // Setup & Call @@ -165,8 +176,14 @@ public void GetIllustrationPointControlItems_ViewWithData_ReturnsExpectedControlItems() { // Setup - TestHydraulicBoundaryLocationsView view = ShowTestHydraulicBoundaryLocationsView(); + var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + var locations = new ObservableList + { + hydraulicBoundaryLocation + }; + TestHydraulicBoundaryLocationsView view = ShowTestHydraulicBoundaryLocationsView(locations); + var topLevelIllustrationPoints = new[] { new TopLevelSubMechanismIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection(), @@ -183,10 +200,6 @@ }; view.ItemToCreate = calculation; - var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); - view.AssessmentSection.HydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - view.AssessmentSection.HydraulicBoundaryDatabase.Locations.NotifyObservers(); - // Call IEnumerable actualControlItems = view.PublicGetIllustrationPointControlItems(); @@ -215,10 +228,15 @@ }); } - private TestHydraulicBoundaryLocationsView ShowTestHydraulicBoundaryLocationsView() + private void ShowTestHydraulicBoundaryLocationsView() { - var view = new TestHydraulicBoundaryLocationsView(); + ShowTestHydraulicBoundaryLocationsView(new ObservableList()); + } + private TestHydraulicBoundaryLocationsView ShowTestHydraulicBoundaryLocationsView(ObservableList locations) + { + var view = new TestHydraulicBoundaryLocationsView(locations); + testForm.Controls.Add(view); testForm.Show(); @@ -227,8 +245,8 @@ private TestHydraulicBoundaryLocationsView ShowFullyConfiguredTestHydraulicBoundaryLocationsView() { - var assessmentSection = new ObservableTestAssessmentSectionStub(); - assessmentSection.HydraulicBoundaryDatabase.Locations.AddRange(new[] + var locations = new ObservableList(); + locations.AddRange(new[] { new HydraulicBoundaryLocation(1, "1", 1.0, 1.0), new HydraulicBoundaryLocation(2, "2", 2.0, 2.0) @@ -257,20 +275,14 @@ } }); - var view = new TestHydraulicBoundaryLocationsView(assessmentSection); - - testForm.Controls.Add(view); - testForm.Show(); - - return view; + return ShowTestHydraulicBoundaryLocationsView(locations); } private sealed class TestHydraulicBoundaryLocationsView : HydraulicBoundaryLocationsView { - public TestHydraulicBoundaryLocationsView() : this(new ObservableTestAssessmentSectionStub()) {} + public TestHydraulicBoundaryLocationsView(ObservableList locations) + : base(locations, new ObservableTestAssessmentSectionStub()) {} - public TestHydraulicBoundaryLocationsView(IAssessmentSection assessmentSection) : base(assessmentSection) {} - public HydraulicBoundaryLocation GetCalculationsCallArgument { get; private set; } public HydraulicBoundaryLocationCalculation ItemToCreate { private get; set; } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs =================================================================== diff -u -r2a95271526986849f52e1391935c8aeecabb0da8 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs) (revision 2a95271526986849f52e1391935c8aeecabb0da8) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsView.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -40,61 +40,40 @@ /// public class GrassCoverErosionOutwardsDesignWaterLevelLocationsView : HydraulicBoundaryLocationsView { - private readonly Observer assessmentSectionObserver; - private readonly Observer hydraulicBoundaryLocationsObserver; + private readonly GrassCoverErosionOutwardsDesignWaterLevelCalculationMessageProvider messageProvider; - private GrassCoverErosionOutwardsFailureMechanism failureMechanism; + private readonly Observer failureMechanismObserver; /// /// Creates a new instance of . /// - /// The assessment section which the locations belong to. - /// Thrown when - /// is null. - public GrassCoverErosionOutwardsDesignWaterLevelLocationsView(IAssessmentSection assessmentSection) - : base(assessmentSection) + /// The failure mechanism that the locations belong to. + /// The assessment section that the locations belong to. + /// Thrown when or + /// is null. + public GrassCoverErosionOutwardsDesignWaterLevelLocationsView(GrassCoverErosionOutwardsFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + : base(failureMechanism?.HydraulicBoundaryLocations, assessmentSection) { - assessmentSectionObserver = new Observer(UpdateCalculateForSelectedButton); - hydraulicBoundaryLocationsObserver = new Observer(UpdateHydraulicBoundaryLocations); + FailureMechanism = failureMechanism; + messageProvider = new GrassCoverErosionOutwardsDesignWaterLevelCalculationMessageProvider(); - assessmentSectionObserver.Observable = AssessmentSection; - } - - public override object Data - { - get + failureMechanismObserver = new Observer(UpdateCalculateForSelectedButton) { - return base.Data; - } - set - { - var data = (ObservableList) value; - base.Data = data; - hydraulicBoundaryLocationsObserver.Observable = data; - } + Observable = failureMechanism + }; } /// /// Gets or sets the for which the /// hydraulic boundary locations are shown. /// - public GrassCoverErosionOutwardsFailureMechanism FailureMechanism - { - get - { - return failureMechanism; - } - set - { - failureMechanism = value; - UpdateCalculateForSelectedButton(); - } - } + public GrassCoverErosionOutwardsFailureMechanism FailureMechanism { get; } protected override void Dispose(bool disposing) { - assessmentSectionObserver.Dispose(); - hydraulicBoundaryLocationsObserver.Dispose(); + failureMechanismObserver.Dispose(); + base.Dispose(disposing); } @@ -111,7 +90,7 @@ return currentRow != null ? new GrassCoverErosionOutwardsDesignWaterLevelLocationContext(((HydraulicBoundaryLocationRow) currentRow.DataBoundItem).CalculatableObject, - (ObservableList) Data) + FailureMechanism.HydraulicBoundaryLocations) : null; } @@ -122,61 +101,23 @@ FailureMechanism.Contribution, FailureMechanism.GeneralInput.N); - bool successfulCalculation = CalculationGuiService.CalculateDesignWaterLevels(AssessmentSection.HydraulicBoundaryDatabase.FilePath, - AssessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), - locations, - mechanismSpecificNorm, - new GrassCoverErosionOutwardsDesignWaterLevelCalculationMessageProvider()); - if (successfulCalculation) - { - ((IObservable) Data).NotifyObservers(); - } + CalculationGuiService.CalculateDesignWaterLevels(AssessmentSection.HydraulicBoundaryDatabase.FilePath, + AssessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), + locations, + mechanismSpecificNorm, + messageProvider); } protected override string ValidateCalculatableObjects() { - if (FailureMechanism != null && FailureMechanism.Contribution <= 0) - { - return RingtoetsCommonFormsResources.Contribution_of_failure_mechanism_zero; - } - - return base.ValidateCalculatableObjects(); + return FailureMechanism != null && FailureMechanism.Contribution <= 0 + ? RingtoetsCommonFormsResources.Contribution_of_failure_mechanism_zero + : base.ValidateCalculatableObjects(); } protected override HydraulicBoundaryLocationCalculation GetCalculation(HydraulicBoundaryLocation location) { return location.DesignWaterLevelCalculation; } - - private void UpdateHydraulicBoundaryLocations() - { - if (IsDataGridDataSourceChanged()) - { - UpdateDataGridViewDataSource(); - } - else - { - HandleHydraulicBoundaryDatabaseUpdate(); - } - } - - private bool IsDataGridDataSourceChanged() - { - var locations = (ObservableList) Data; - int count = dataGridViewControl.Rows.Count; - if (count != locations.Count) - { - return true; - } - for (var i = 0; i < count; i++) - { - HydraulicBoundaryLocation locationFromGrid = ((HydraulicBoundaryLocationRow) dataGridViewControl.Rows[i].DataBoundItem).CalculatableObject; - if (!ReferenceEquals(locationFromGrid, locations[i])) - { - return true; - } - } - return false; - } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsWaveHeightLocationsView.cs =================================================================== diff -u -r2a95271526986849f52e1391935c8aeecabb0da8 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsWaveHeightLocationsView.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsView.cs) (revision 2a95271526986849f52e1391935c8aeecabb0da8) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsWaveHeightLocationsView.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsView.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -52,7 +52,7 @@ /// Thrown when /// is null. public GrassCoverErosionOutwardsWaveHeightLocationsView(IAssessmentSection assessmentSection) - : base(assessmentSection) + : base(null, assessmentSection) { assessmentSectionObserver = new Observer(UpdateCalculateForSelectedButton); hydraulicBoundaryLocationsObserver = new Observer(UpdateHydraulicBoundaryLocations); Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u -r66c2f121366073bd6f2944ee0d9c5ec664a4cd09 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 66c2f121366073bd6f2944ee0d9c5ec664a4cd09) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -141,10 +141,9 @@ GetViewName = (view, locations) => RingtoetsGrassCoverErosionOutwardsFormsResources.GrassCoverErosionOutwardsWaterLevelLocations_DisplayName, GetViewData = context => context.WrappedData, Image = RingtoetsCommonFormsResources.GenericInputOutputIcon, - CreateInstance = context => new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(context.AssessmentSection), + CreateInstance = context => new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(context.FailureMechanism, context.AssessmentSection), AfterCreate = (view, context) => { - view.FailureMechanism = context.FailureMechanism; view.CalculationGuiService = hydraulicBoundaryLocationCalculationGuiService; }, CloseForData = CloseDesignWaterLevelLocationsViewForData Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -133,5 +133,9 @@ {18E9F7C8-3170-4E9D-8D9F-1378225EED90} Ringtoets.GrassCoverErosionOutwards.Service + + {C7A0BCEB-D7F9-4DC0-9F9B-29FF8DD2E4BE} + Ringtoets.GrassCoverErosionOutwards.Plugin.Test + \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r9898898db318ce2cd3510b5fbff919a750c7ca0e -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 9898898db318ce2cd3510b5fbff919a750c7ca0e) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -77,14 +77,15 @@ } [Test] - public void DefaultConstructor_DefaultValues() + public void Constructor_ExpectedValues() { // Setup - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); mockRepository.ReplayAll(); // Call - using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(assessmentSection)) + using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(new GrassCoverErosionOutwardsFailureMechanism(), + assessmentSection)) { // Assert Assert.IsInstanceOf(view); @@ -93,10 +94,25 @@ } [Test] + public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() + { + // Setup + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); + mockRepository.ReplayAll(); + + // Call + TestDelegate call = () => new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(null, assessmentSection); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("locations", exception.ParamName); + } + + [Test] public void Constructor_DataGridViewCorrectlyInitialized() { // Setup - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); mockRepository.ReplayAll(); // Call @@ -129,31 +145,10 @@ } [Test] - public void DesignWaterLevelLocationsView_WithNonIObservableList_ThrowsInvalidCastException() - { - // Setup - var assessmentSection = mockRepository.Stub(); - mockRepository.ReplayAll(); - - GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowDesignWaterLevelLocationsView(assessmentSection, testForm); - - var locations = new List - { - new TestHydraulicBoundaryLocation() - }; - - // Call - TestDelegate action = () => view.Data = locations; - - // Assert - Assert.Throws(action); - } - - [Test] public void DesignWaterLevelLocationsView_AssessmentSectionWithData_DataGridViewCorrectlyInitialized() { // Setup - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); mockRepository.ReplayAll(); // Call @@ -214,11 +209,11 @@ public void DesignWaterLevelLocationsView_HydraulicBoundaryDatabaseUpdated_DataGridViewCorrectlyUpdated() { // Setup - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); mockRepository.ReplayAll(); GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); - var locations = (ObservableList) view.Data; + ObservableList locations = view.FailureMechanism.HydraulicBoundaryLocations; // Precondition DataGridView locationsDataGridView = GetLocationsDataGridView(); @@ -263,7 +258,7 @@ public void DesignWaterLevelLocationsView_HydraulicBoundaryDatabaseUpdated_IllustrationPointsControlCorrectlyUpdated() { // Setup - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); mockRepository.ReplayAll(); GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); @@ -284,11 +279,11 @@ var generalResult = new TestGeneralResultSubMechanismIllustrationPoint(topLevelIllustrationPoints); var output = new TestHydraulicBoundaryLocationOutput(generalResult); - var locations = (ObservableList) view.Data; + ObservableList locations = view.FailureMechanism.HydraulicBoundaryLocations; // Call locations[3].DesignWaterLevelCalculation.Output = output; - locations.NotifyObservers(); + locations[3].NotifyObservers(); // Assert IEnumerable expectedControlItems = CreateControlItems(generalResult); @@ -301,7 +296,7 @@ public void CalculateForSelectedButton_OneSelected_CallsCalculateDesignWaterLevelsSelectionNotChanged(bool isSuccessful) { // Setup - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); assessmentSection.Stub(ass => ass.Id).Return(string.Empty); assessmentSection.Stub(ass => ass.FailureMechanismContribution) .Return(FailureMechanismContributionTestFactory.CreateFailureMechanismContribution()); @@ -311,32 +306,18 @@ var guiService = mockRepository.StrictMock(); - var observer = mockRepository.StrictMock(); - - if (isSuccessful) - { - observer.Expect(o => o.UpdateObserver()); - } - HydraulicBoundaryLocation[] calculatedLocations = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, 1, null)).IgnoreArguments().WhenCalled( invocation => { calculatedLocations = ((IEnumerable) invocation.Arguments[2]).ToArray(); }).Return(isSuccessful); mockRepository.ReplayAll(); GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); - var locations = (ObservableList) view.Data; DataGridView locationsDataGridView = GetLocationsDataGridView(); object dataGridViewSource = locationsDataGridView.DataSource; DataGridViewRowCollection rows = locationsDataGridView.Rows; rows[0].Cells[locationCalculateColumnIndex].Value = true; - locations.Attach(observer); - - view.FailureMechanism = new GrassCoverErosionOutwardsFailureMechanism - { - Contribution = 10 - }; view.CalculationGuiService = guiService; var buttonTester = new ButtonTester("CalculateForSelectedButton", testForm); @@ -345,7 +326,7 @@ // Assert Assert.AreEqual(1, calculatedLocations.Length); - HydraulicBoundaryLocation expectedLocation = locations.First(); + HydraulicBoundaryLocation expectedLocation = view.FailureMechanism.HydraulicBoundaryLocations.First(); Assert.AreEqual(expectedLocation, calculatedLocations.First()); Assert.AreSame(dataGridViewSource, locationsDataGridView.DataSource); Assert.IsTrue((bool) rows[0].Cells[locationCalculateColumnIndex].Value); @@ -357,7 +338,7 @@ public void CalculateForSelectedButton_OneSelectedButCalculationGuiServiceNotSet_DoesNotThrowException() { // Setup - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); mockRepository.ReplayAll(); ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); @@ -385,10 +366,15 @@ string expectedErrorMessage) { // Given - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); mockRepository.ReplayAll(); GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); + if (!contributionNotZero) + { + view.FailureMechanism.Contribution = 0; + view.FailureMechanism.NotifyObservers(); + } // When if (rowSelected) @@ -397,14 +383,7 @@ DataGridViewRowCollection rows = locationsDataGridViewControl.Rows; rows[0].Cells[locationCalculateColumnIndex].Value = true; } - - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); - if (contributionNotZero) - { - failureMechanism.Contribution = 5; - } - view.FailureMechanism = failureMechanism; - + // Then var button = (Button) view.Controls.Find("CalculateForSelectedButton", true)[0]; Assert.AreEqual(rowSelected && contributionNotZero, button.Enabled); @@ -418,14 +397,9 @@ // Setup const string databaseFilePath = "DatabaseFilePath"; - var assessmentSection = mockRepository.Stub(); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = databaseFilePath - }; - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - assessmentSection.Stub(ass => ass.Id).Return(string.Empty); - assessmentSection.Stub(ass => ass.FailureMechanismContribution) + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); + assessmentSection.Stub(a => a.Id).Return(string.Empty); + assessmentSection.Stub(a => a.FailureMechanismContribution) .Return(FailureMechanismContributionTestFactory.CreateFailureMechanismContribution()); assessmentSection.Stub(a => a.Attach(null)).IgnoreArguments(); assessmentSection.Stub(a => a.Detach(null)).IgnoreArguments(); @@ -449,18 +423,17 @@ mockRepository.ReplayAll(); + assessmentSection.HydraulicBoundaryDatabase.FilePath = databaseFilePath; + GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); - var locations = (ObservableList) view.Data; + ObservableList locations = view.FailureMechanism.HydraulicBoundaryLocations; DataGridView locationsDataGridView = GetLocationsDataGridView(); DataGridViewRowCollection rows = locationsDataGridView.Rows; rows[0].Cells[locationCalculateColumnIndex].Value = true; + GrassCoverErosionOutwardsFailureMechanism failureMechanism = view.FailureMechanism; + view.CalculationGuiService = guiService; - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism - { - Contribution = 10 - }; - view.FailureMechanism = failureMechanism; var button = new ButtonTester("CalculateForSelectedButton", testForm); // Call @@ -488,15 +461,7 @@ const string databaseFilePath = "DatabaseFilePath"; string preprocessorDirectory = TestHelper.GetScratchPadPath(); - var assessmentSection = mockRepository.Stub(); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = databaseFilePath, - CanUsePreprocessor = true, - UsePreprocessor = true, - PreprocessorDirectory = preprocessorDirectory - }; - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); assessmentSection.Stub(ass => ass.Id).Return(string.Empty); assessmentSection.Stub(ass => ass.FailureMechanismContribution) .Return(FailureMechanismContributionTestFactory.CreateFailureMechanismContribution()); @@ -522,18 +487,23 @@ mockRepository.ReplayAll(); + HydraulicBoundaryDatabase hydraulicBoundaryDatabase = assessmentSection.HydraulicBoundaryDatabase; + hydraulicBoundaryDatabase.FilePath = databaseFilePath; + hydraulicBoundaryDatabase.CanUsePreprocessor = true; + hydraulicBoundaryDatabase.UsePreprocessor = true; + hydraulicBoundaryDatabase.PreprocessorDirectory = preprocessorDirectory; + GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); - var locations = (ObservableList) view.Data; DataGridView locationsDataGridView = GetLocationsDataGridView(); DataGridViewRowCollection rows = locationsDataGridView.Rows; rows[0].Cells[locationCalculateColumnIndex].Value = true; view.CalculationGuiService = guiService; - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism - { - Contribution = 10 - }; - view.FailureMechanism = failureMechanism; + + GrassCoverErosionOutwardsFailureMechanism failureMechanism = view.FailureMechanism; + failureMechanism.Contribution = 10; + failureMechanism.NotifyObservers(); + var button = new ButtonTester("CalculateForSelectedButton", testForm); // Call @@ -550,7 +520,7 @@ Assert.AreEqual(preprocessorDirectory, preprocessorDirectoryValue); Assert.AreEqual(expectedNorm, normValue); Assert.AreEqual(1, calculatedLocationsValue.Length); - HydraulicBoundaryLocation expectedLocation = locations.First(); + HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); } @@ -560,20 +530,12 @@ // Setup const string databaseFilePath = "DatabaseFilePath"; - var assessmentSection = mockRepository.Stub(); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - FilePath = databaseFilePath, - CanUsePreprocessor = true, - UsePreprocessor = false, - PreprocessorDirectory = "InvalidPreprocessorDirectory" - }; - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); assessmentSection.Stub(ass => ass.Id).Return(string.Empty); assessmentSection.Stub(ass => ass.FailureMechanismContribution) .Return(FailureMechanismContributionTestFactory.CreateFailureMechanismContribution()); assessmentSection.Stub(a => a.Attach(null)).IgnoreArguments(); - assessmentSection.Stub(a => a.Detach(null)).IgnoreArguments(); + assessmentSection.Stub(a => a.Detach(null)).IgnoreArguments(); var guiService = mockRepository.StrictMock(); @@ -594,18 +556,22 @@ mockRepository.ReplayAll(); - GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); - var locations = (ObservableList) view.Data; + HydraulicBoundaryDatabase hydraulicBoundaryDatabase = assessmentSection.HydraulicBoundaryDatabase; + hydraulicBoundaryDatabase.FilePath = databaseFilePath; + hydraulicBoundaryDatabase.CanUsePreprocessor = true; + hydraulicBoundaryDatabase.UsePreprocessor = false; + hydraulicBoundaryDatabase.PreprocessorDirectory = "InvalidPreprocessorDirectory"; + + GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, testForm); DataGridView locationsDataGridView = GetLocationsDataGridView(); DataGridViewRowCollection rows = locationsDataGridView.Rows; rows[0].Cells[locationCalculateColumnIndex].Value = true; + GrassCoverErosionOutwardsFailureMechanism failureMechanism = view.FailureMechanism; + failureMechanism.Contribution = 10; + failureMechanism.NotifyObservers(); + view.CalculationGuiService = guiService; - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism - { - Contribution = 10 - }; - view.FailureMechanism = failureMechanism; var button = new ButtonTester("CalculateForSelectedButton", testForm); // Call @@ -622,7 +588,7 @@ Assert.AreEqual("", preprocessorDirectoryValue); Assert.AreEqual(expectedNorm, normValue); Assert.AreEqual(1, calculatedLocationsValue.Length); - HydraulicBoundaryLocation expectedLocation = locations.First(); + HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); } @@ -656,10 +622,22 @@ }); } - private static GrassCoverErosionOutwardsDesignWaterLevelLocationsView ShowDesignWaterLevelLocationsView(IAssessmentSection assessmentSection, Form form) + private static void ShowDesignWaterLevelLocationsView(IAssessmentSection assessmentSection, Form form) { - var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(assessmentSection); + ShowDesignWaterLevelLocationsView(new ObservableList(), assessmentSection, form); + } + private static GrassCoverErosionOutwardsDesignWaterLevelLocationsView ShowDesignWaterLevelLocationsView(ObservableList locations, + IAssessmentSection assessmentSection, Form form) + { + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism + { + Contribution = 10 + }; + failureMechanism.HydraulicBoundaryLocations.AddRange(locations); + + var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(failureMechanism, assessmentSection); + form.Controls.Add(view); form.Show(); @@ -668,8 +646,6 @@ private static GrassCoverErosionOutwardsDesignWaterLevelLocationsView ShowFullyConfiguredDesignWaterLevelLocationsView(IAssessmentSection assessmentSection, Form form) { - GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowDesignWaterLevelLocationsView(assessmentSection, form); - var topLevelIllustrationPoints = new[] { new TopLevelSubMechanismIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection(), @@ -683,7 +659,7 @@ var generalResult = new TestGeneralResultSubMechanismIllustrationPoint(topLevelIllustrationPoints); var output = new TestHydraulicBoundaryLocationOutput(1.01, generalResult); - view.Data = new ObservableList + var locations = new ObservableList { new HydraulicBoundaryLocation(1, "1", 1.0, 1.0), new HydraulicBoundaryLocation(2, "2", 2.0, 2.0) @@ -723,7 +699,7 @@ } }; - return view; + return ShowDesignWaterLevelLocationsView(locations, assessmentSection, form); } [TestFixture] @@ -740,7 +716,7 @@ protected override object GetLocationSelection(LocationsView view, object selectedRowObject) { return new GrassCoverErosionOutwardsDesignWaterLevelLocationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject, - (ObservableList) view.Data); + ((GrassCoverErosionOutwardsDesignWaterLevelLocationsView)view).FailureMechanism.HydraulicBoundaryLocations); } protected override LocationsView ShowFullyConfiguredLocationsView(Form form) @@ -750,7 +726,7 @@ protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view) { - var locations = (ObservableList) view.Data; + ObservableList locations = ((GrassCoverErosionOutwardsDesignWaterLevelLocationsView)view).FailureMechanism.HydraulicBoundaryLocations; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0); locations.Clear(); @@ -760,18 +736,22 @@ protected override void ClearLocationOutputAndNotifyObservers(LocationsView view) { - var locations = (ObservableList) view.Data; + ObservableList locations = ((GrassCoverErosionOutwardsDesignWaterLevelLocationsView) view).FailureMechanism.HydraulicBoundaryLocations; - locations.ForEach(loc => loc.DesignWaterLevelCalculation.Output = null); - locations.NotifyObservers(); + locations.ForEach(loc => + { + loc.DesignWaterLevelCalculation.Output = null; + loc.NotifyObservers(); + }); } protected override void AddLocationOutputAndNotifyObservers(LocationsView view) { - var locations = (ObservableList) view.Data; + ObservableList locations = ((GrassCoverErosionOutwardsDesignWaterLevelLocationsView)view).FailureMechanism.HydraulicBoundaryLocations; - locations.First().DesignWaterLevelCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint()); - locations.NotifyObservers(); + HydraulicBoundaryLocation location = locations.First(); + location.DesignWaterLevelCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint()); + location.NotifyObservers(); } } } Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Integration.Test/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewIntegrationTest.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Integration.Test/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewIntegrationTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewIntegrationTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Integration.Test/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewIntegrationTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewIntegrationTest.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -21,7 +21,6 @@ using System.Linq; using System.Windows.Forms; -using Core.Common.Base; using Core.Common.Util.Reflection; using NUnit.Framework; using Rhino.Mocks; @@ -75,12 +74,12 @@ rows[0].Cells[locationCalculateColumnIndex].Value = true; } - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); - if (!contributionAfterChangeNotZero) + GrassCoverErosionOutwardsFailureMechanism failureMechanism = view.FailureMechanism; + if (contributionAfterChangeNotZero) { - failureMechanism.Contribution = 5; + failureMechanism.Contribution = 0; + failureMechanism.NotifyObservers(); } - view.FailureMechanism = failureMechanism; // Precondition var button = (Button) view.Controls.Find("CalculateForSelectedButton", true)[0]; @@ -90,28 +89,21 @@ // When failureMechanism.Contribution = contributionAfterChangeNotZero ? 5 : 0; - view.AssessmentSection.NotifyObservers(); + failureMechanism.NotifyObservers(); // Then Assert.AreEqual(rowSelected && contributionAfterChangeNotZero, button.Enabled); Assert.AreEqual(expectedErrorMessage, errorProvider.GetError(button)); } - private GrassCoverErosionOutwardsDesignWaterLevelLocationsView ShowDesignWaterLevelLocationsView() - { - var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(new AssessmentSection(AssessmentSectionComposition.Dike)); - - testForm.Controls.Add(view); - testForm.Show(); - - return view; - } - private GrassCoverErosionOutwardsDesignWaterLevelLocationsView ShowFullyConfiguredDesignWaterLevelLocationsView() { - GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowDesignWaterLevelLocationsView(); - view.Data = new ObservableList + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism { + Contribution = 5 + }; + failureMechanism.HydraulicBoundaryLocations.AddRange(new[] + { new HydraulicBoundaryLocation(1, "1", 1.0, 1.0), new HydraulicBoundaryLocation(2, "2", 2.0, 2.0) { @@ -127,7 +119,13 @@ Output = new TestHydraulicBoundaryLocationOutput(2.45) } } - }; + }); + var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(failureMechanism, + new AssessmentSection(AssessmentSectionComposition.Dike)); + + testForm.Controls.Add(view); + testForm.Show(); + return view; } } Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewInfoTest.cs =================================================================== diff -u -r04cf5f873b69cb330aeda88b622e286b2aefa852 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewInfoTest.cs) (revision 04cf5f873b69cb330aeda88b622e286b2aefa852) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewInfoTest.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -145,7 +145,7 @@ plugin.Gui = gui; plugin.Activate(); - using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(assessmentSection)) + using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(grassCoverErosionOutwardsFailureMechanism, assessmentSection)) { // Call info.AfterCreate(view, data); @@ -162,17 +162,19 @@ public void CloseViewForData_ForMatchingAssessmentSection_ReturnsTrue() { // Setup + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); + var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); assessmentSection.Stub(a => a.GetFailureMechanisms()).Return(new[] { - new GrassCoverErosionOutwardsFailureMechanism() + failureMechanism }); assessmentSection.Stub(a => a.Attach(null)).IgnoreArguments(); assessmentSection.Stub(a => a.Detach(null)).IgnoreArguments(); mocks.ReplayAll(); - using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(assessmentSection)) + using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(failureMechanism, assessmentSection)) using (var plugin = new GrassCoverErosionOutwardsPlugin()) { ViewInfo info = GetInfo(plugin); @@ -190,6 +192,8 @@ public void CloseViewForData_ForNonMatchingAssessmentSection_ReturnsFalse() { // Setup + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); + var mocks = new MockRepository(); var assessmentSectionA = mocks.Stub(); var assessmentSectionB = mocks.Stub(); @@ -201,11 +205,11 @@ assessmentSectionA.Stub(a => a.Detach(null)).IgnoreArguments(); assessmentSectionB.Stub(a => a.GetFailureMechanisms()).Return(new[] { - new GrassCoverErosionOutwardsFailureMechanism() + failureMechanism }); mocks.ReplayAll(); - using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(assessmentSectionA)) + using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(failureMechanism, assessmentSectionA)) using (var plugin = new GrassCoverErosionOutwardsPlugin()) { ViewInfo info = GetInfo(plugin); @@ -237,7 +241,8 @@ new GrassCoverErosionOutwardsFailureMechanism(), assessmentSection); - using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(assessmentSection)) + using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(new GrassCoverErosionOutwardsFailureMechanism(), + assessmentSection)) using (var plugin = new GrassCoverErosionOutwardsPlugin()) { ViewInfo info = GetInfo(plugin); @@ -274,7 +279,7 @@ new GrassCoverErosionOutwardsFailureMechanism(), assessmentSectionB); - using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(assessmentSectionA)) + using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(new GrassCoverErosionOutwardsFailureMechanism(), assessmentSectionA)) using (var plugin = new GrassCoverErosionOutwardsPlugin()) { ViewInfo info = GetInfo(plugin); @@ -302,7 +307,7 @@ assessmentSection.Stub(a => a.Detach(null)).IgnoreArguments(); mocks.ReplayAll(); - using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(assessmentSection)) + using (var view = new GrassCoverErosionOutwardsDesignWaterLevelLocationsView(new GrassCoverErosionOutwardsFailureMechanism(), assessmentSection)) using (var plugin = new GrassCoverErosionOutwardsPlugin()) { ViewInfo info = GetInfo(plugin); Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs =================================================================== diff -u -red6842895114989426eeb1f660598a05d3bd9785 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs (.../DesignWaterLevelLocationsView.cs) (revision ed6842895114989426eeb1f660598a05d3bd9785) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs (.../DesignWaterLevelLocationsView.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -43,7 +43,7 @@ /// Thrown when /// is null. public DesignWaterLevelLocationsView(IAssessmentSection assessmentSection) - : base(assessmentSection) + : base(assessmentSection?.HydraulicBoundaryDatabase.Locations, assessmentSection) { InitializeComponent(); } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs =================================================================== diff -u -red6842895114989426eeb1f660598a05d3bd9785 -rf4720b27ed71fe3f179b4301c3c0993cb9fe9094 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs (.../WaveHeightLocationsView.cs) (revision ed6842895114989426eeb1f660598a05d3bd9785) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs (.../WaveHeightLocationsView.cs) (revision f4720b27ed71fe3f179b4301c3c0993cb9fe9094) @@ -43,7 +43,7 @@ /// Thrown when /// is null. public WaveHeightLocationsView(IAssessmentSection assessmentSection) - : base(assessmentSection) + : base(assessmentSection?.HydraulicBoundaryDatabase.Locations, assessmentSection) { InitializeComponent(); }