Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs =================================================================== diff -u -r8cd1182cc7d1850984e42a0110ebed82666842fe -r76853a633e4f50f0059f9beedda3f85e3a602812 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 8cd1182cc7d1850984e42a0110ebed82666842fe) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 76853a633e4f50f0059f9beedda3f85e3a602812) @@ -29,6 +29,7 @@ using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; @@ -53,20 +54,54 @@ private const int calculationsIndex = 6; [Test] + public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + // Call + TestDelegate call = () => new StabilityStoneCoverFailureMechanismView(null, assessmentSection); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("failureMechanism", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + } + + [Test] public void Constructor_ExpectedValues() { + // Setup + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + // Call - using (var view = new StabilityStoneCoverFailureMechanismView()) + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, assessmentSection)) { // Assert Assert.IsInstanceOf(view); Assert.IsInstanceOf(view); Assert.IsNull(view.Data); + Assert.AreSame(failureMechanism, view.FailureMechanism); + Assert.AreSame(assessmentSection, view.AssessmentSection); Assert.AreEqual(1, view.Controls.Count); Assert.IsInstanceOf(view.Controls[0]); - Assert.AreSame(view.Map, ((RingtoetsMapControl)view.Controls[0]).MapControl); - Assert.AreEqual(DockStyle.Fill, ((Control)view.Map).Dock); + Assert.AreSame(view.Map, ((RingtoetsMapControl) view.Controls[0]).MapControl); + Assert.AreEqual(DockStyle.Fill, ((Control) view.Map).Dock); AssertEmptyMapData(view.Map.Data); } } @@ -75,7 +110,7 @@ public void Data_StabilityStoneCoverFailureMechanismContext_DataSet() { // Setup - using (var view = new StabilityStoneCoverFailureMechanismView()) + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), new ObservableTestAssessmentSectionStub())) { var assessmentSection = new ObservableTestAssessmentSectionStub(); @@ -94,7 +129,7 @@ public void Data_OtherThanStabilityStoneCoverFailureMechanismContext_DataNull() { // Setup - using (var view = new StabilityStoneCoverFailureMechanismView()) + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), new ObservableTestAssessmentSectionStub())) { var data = new object(); @@ -112,7 +147,7 @@ // Setup IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub(); - using (var view = new StabilityStoneCoverFailureMechanismView()) + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), assessmentSection)) { var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext( new StabilityStoneCoverFailureMechanism(), assessmentSection); @@ -129,10 +164,10 @@ public void Data_SetToNull_MapDataCleared() { // Setup - using (var view = new StabilityStoneCoverFailureMechanismView()) - { - var assessmentSection = new ObservableTestAssessmentSectionStub(); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), assessmentSection)) + { var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext( new StabilityStoneCoverFailureMechanism(), assessmentSection); @@ -156,10 +191,10 @@ public void Data_EmptyStabilityStoneCoverFailureMechanismContext_NoMapDataSet() { // Setup - using (var view = new StabilityStoneCoverFailureMechanismView()) - { - var assessmentSection = new ObservableTestAssessmentSectionStub(); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), assessmentSection)) + { var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext( new StabilityStoneCoverFailureMechanism(), assessmentSection); @@ -177,81 +212,78 @@ public void Data_StabilityStoneCoverFailureMechanismContext_DataUpdatedToCollectionOfFilledMapData() { // Setup - using (var view = new StabilityStoneCoverFailureMechanismView()) + var calculationA = new StabilityStoneCoverWaveConditionsCalculation { - IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - - var geometryPoints = new[] + InputParameters = { - new Point2D(0.0, 0.0), - new Point2D(2.0, 0.0), - new Point2D(4.0, 4.0), - new Point2D(6.0, 4.0) - }; - - var referenceLine = new ReferenceLine(); - referenceLine.SetGeometry(new[] + ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.3, 1.3)), + HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() + } + }; + var calculationB = new StabilityStoneCoverWaveConditionsCalculation + { + InputParameters = { - new Point2D(1.0, 2.0), - new Point2D(2.0, 1.0) - }); + ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.5, 1.5)), + HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() + } + }; - var assessmentSection = new ObservableTestAssessmentSectionStub - { - HydraulicBoundaryDatabase = - { - Locations = - { - new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) - } - }, - ReferenceLine = referenceLine - }; + var geometryPoints = new[] + { + new Point2D(0.0, 0.0), + new Point2D(2.0, 0.0), + new Point2D(4.0, 4.0), + new Point2D(6.0, 4.0) + }; - var foreshoreProfileA = new TestForeshoreProfile(new Point2D(1.3, 1.3)); - var foreshoreProfileB = new TestForeshoreProfile(new Point2D(1.5, 1.5)); + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + failureMechanism.AddSection(new FailureMechanismSection("A", geometryPoints.Take(2))); + failureMechanism.AddSection(new FailureMechanismSection("B", geometryPoints.Skip(1).Take(2))); + failureMechanism.AddSection(new FailureMechanismSection("C", geometryPoints.Skip(2).Take(2))); - var calculationA = new StabilityStoneCoverWaveConditionsCalculation + var profile1 = new TestForeshoreProfile("profile1 ID", new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + }); + var profile2 = new TestForeshoreProfile("profile2 ID", new[] + { + new Point2D(2, 2), + new Point2D(3, 3) + }); + failureMechanism.ForeshoreProfiles.AddRange(new[] + { + profile1, + profile2 + }, "path"); + + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationA); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationB); + + var referenceLine = new ReferenceLine(); + referenceLine.SetGeometry(new[] + { + new Point2D(1.0, 2.0), + new Point2D(2.0, 1.0) + }); + + var assessmentSection = new ObservableTestAssessmentSectionStub + { + HydraulicBoundaryDatabase = { - InputParameters = + Locations = { - ForeshoreProfile = foreshoreProfileA, - HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() + new HydraulicBoundaryLocation(1, "test", 1.0, 2.0) } - }; - var calculationB = new StabilityStoneCoverWaveConditionsCalculation - { - InputParameters = - { - ForeshoreProfile = foreshoreProfileB, - HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() - } - }; + }, + ReferenceLine = referenceLine + }; - var failureMechanism = new StabilityStoneCoverFailureMechanism(); - failureMechanism.AddSection(new FailureMechanismSection("A", geometryPoints.Take(2))); - failureMechanism.AddSection(new FailureMechanismSection("B", geometryPoints.Skip(1).Take(2))); - failureMechanism.AddSection(new FailureMechanismSection("C", geometryPoints.Skip(2).Take(2))); + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, assessmentSection)) + { + IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var profile1 = new TestForeshoreProfile("profile1 ID", new[] - { - new Point2D(0, 0), - new Point2D(1, 1) - }); - var profile2 = new TestForeshoreProfile("profile2 ID", new[] - { - new Point2D(2, 2), - new Point2D(3, 3) - }); - failureMechanism.ForeshoreProfiles.AddRange(new[] - { - profile1, - profile2 - }, "path"); - - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationA); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationB); - var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection); // Call @@ -279,21 +311,21 @@ public void GivenViewWithHydraulicBoundaryLocationsData_WhenHydraulicBoundaryLocationsUpdatedAndNotified_ThenMapDataUpdated() { // Given - using (var view = new StabilityStoneCoverFailureMechanismView()) + var assessmentSection = new ObservableTestAssessmentSectionStub { - IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - - var assessmentSection = new ObservableTestAssessmentSectionStub + HydraulicBoundaryDatabase = { - HydraulicBoundaryDatabase = + Locations = { - Locations = - { - new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0) - } + new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0) } - }; + } + }; + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), assessmentSection)) + { + IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; + var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(new StabilityStoneCoverFailureMechanism(), assessmentSection); view.Data = failureMechanismContext; @@ -316,23 +348,23 @@ public void GivenViewWithHydraulicBoundaryLocationsData_WhenLocationUpdatedAndNotified_ThenMapDataUpdated() { // Given - var random = new Random(21); - using (var view = new StabilityStoneCoverFailureMechanismView()) + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0); + var assessmentSection = new ObservableTestAssessmentSectionStub { - IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test1", 1.0, 2.0); - var assessmentSection = new ObservableTestAssessmentSectionStub + HydraulicBoundaryDatabase = { - HydraulicBoundaryDatabase = + Locations = { - Locations = - { - hydraulicBoundaryLocation - } + hydraulicBoundaryLocation } - }; + } + }; + var random = new Random(21); + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), assessmentSection)) + { + IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; + var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(new StabilityStoneCoverFailureMechanism(), assessmentSection); view.Data = failureMechanismContext; @@ -364,28 +396,20 @@ public void GivenViewWithReferenceLineData_WhenReferenceLineUpdatedAndNotified_ThenMapDataUpdated() { // Given - using (var view = new StabilityStoneCoverFailureMechanismView()) + var assessmentSection = new ObservableTestAssessmentSectionStub { + ReferenceLine = new ReferenceLine() + }; + assessmentSection.ReferenceLine.SetGeometry(new List + { + new Point2D(1.0, 2.0), + new Point2D(2.0, 1.0) + }); + + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), assessmentSection)) + { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var points1 = new List - { - new Point2D(1.0, 2.0), - new Point2D(2.0, 1.0) - }; - - var points2 = new List - { - new Point2D(2.0, 5.0), - new Point2D(4.0, 3.0) - }; - - var assessmentSection = new ObservableTestAssessmentSectionStub - { - ReferenceLine = new ReferenceLine() - }; - assessmentSection.ReferenceLine.SetGeometry(points1); - var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(new StabilityStoneCoverFailureMechanism(), assessmentSection); view.Data = failureMechanismContext; @@ -396,7 +420,11 @@ MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); // When - assessmentSection.ReferenceLine.SetGeometry(points2); + assessmentSection.ReferenceLine.SetGeometry(new List + { + new Point2D(2.0, 5.0), + new Point2D(4.0, 3.0) + }); assessmentSection.NotifyObservers(); // Then @@ -408,13 +436,13 @@ public void GivenViewWithFailureMechanismSectionsData_WhenFailureMechanismSectionsUpdatedAndNotified_ThenMapDataUpdated() { // Given - using (var view = new StabilityStoneCoverFailureMechanismView()) + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, new ObservableTestAssessmentSectionStub())) { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var failureMechanism = new StabilityStoneCoverFailureMechanism(); var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - view.Data = failureMechanismContext; var sectionMapData = (MapLineData) map.Data.Collection.ElementAt(sectionsIndex); @@ -440,23 +468,23 @@ public void GivenViewWithForeshoreProfileData_WhenForeshoreProfileUpdatedAndNotified_ThenMapDataUpdated() { // Given - using (var view = new StabilityStoneCoverFailureMechanismView()) + var foreshoreProfile = new TestForeshoreProfile("originalProfile ID", new[] { - IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; + new Point2D(0, 0), + new Point2D(1, 1) + }); - var failureMechanism = new StabilityStoneCoverFailureMechanism(); - var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + failureMechanism.ForeshoreProfiles.AddRange(new[] + { + foreshoreProfile + }, "path"); - var foreshoreProfile = new TestForeshoreProfile("originalProfile ID", new[] - { - new Point2D(0, 0), - new Point2D(1, 1) - }); - failureMechanism.ForeshoreProfiles.AddRange(new[] - { - foreshoreProfile - }, "path"); + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, new ObservableTestAssessmentSectionStub())) + { + IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; + var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); view.Data = failureMechanismContext; MapData foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); @@ -482,22 +510,21 @@ public void GivenViewWithForeshoreProfilesData_WhenForeshoreProfilesUpdatedAndNotified_ThenMapDataUpdated() { // Given - using (var view = new StabilityStoneCoverFailureMechanismView()) + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + failureMechanism.ForeshoreProfiles.AddRange(new[] { + new TestForeshoreProfile("originalProfile ID", new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + }) + }, "path"); + + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, new ObservableTestAssessmentSectionStub())) + { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var failureMechanism = new StabilityStoneCoverFailureMechanism(); var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - - failureMechanism.ForeshoreProfiles.AddRange(new[] - { - new TestForeshoreProfile("originalProfile ID", new[] - { - new Point2D(0, 0), - new Point2D(1, 1) - }) - }, "path"); - view.Data = failureMechanismContext; MapData foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); @@ -525,34 +552,22 @@ public void GivenViewWithCalculationGroupData_WhenCalculationGroupUpdatedAndNotified_ThenMapDataUpdated() { // Given - using (var view = new StabilityStoneCoverFailureMechanismView()) + var calculationA = new StabilityStoneCoverWaveConditionsCalculation { + InputParameters = + { + ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.3, 1.3)), + HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() + } + }; + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationA); + + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, new ObservableTestAssessmentSectionStub())) + { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var failureMechanism = new StabilityStoneCoverFailureMechanism(); var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - - var foreshoreProfileA = new TestForeshoreProfile(new Point2D(1.3, 1.3)); - var foreshoreProfileB = new TestForeshoreProfile(new Point2D(1.5, 1.5)); - - var calculationA = new StabilityStoneCoverWaveConditionsCalculation - { - InputParameters = - { - ForeshoreProfile = foreshoreProfileA, - HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() - } - }; - var calculationB = new StabilityStoneCoverWaveConditionsCalculation - { - InputParameters = - { - ForeshoreProfile = foreshoreProfileB, - HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() - } - }; - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationA); - view.Data = failureMechanismContext; var calculationMapData = (MapLineData) map.Data.Collection.ElementAt(calculationsIndex); @@ -562,6 +577,14 @@ calculationMapData); // When + var calculationB = new StabilityStoneCoverWaveConditionsCalculation + { + InputParameters = + { + ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.5, 1.5)), + HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() + } + }; failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationB); failureMechanism.WaveConditionsCalculationGroup.NotifyObservers(); @@ -574,26 +597,22 @@ public void GivenViewWithCalculationInputData_WhenCalculationInputUpdatedAndNotified_ThenMapDataUpdated() { // Given - using (var view = new StabilityStoneCoverFailureMechanismView()) + var calculationA = new StabilityStoneCoverWaveConditionsCalculation { + InputParameters = + { + ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.3, 1.3)), + HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() + } + }; + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationA); + + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, new ObservableTestAssessmentSectionStub())) + { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var failureMechanism = new StabilityStoneCoverFailureMechanism(); var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - - var foreshoreProfileA = new TestForeshoreProfile(new Point2D(1.3, 1.3)); - var foreshoreProfileB = new TestForeshoreProfile(new Point2D(1.5, 1.5)); - - var calculationA = new StabilityStoneCoverWaveConditionsCalculation - { - InputParameters = - { - ForeshoreProfile = foreshoreProfileA, - HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() - } - }; - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationA); - view.Data = failureMechanismContext; var calculationMapData = (MapLineData) map.Data.Collection.ElementAt(calculationsIndex); @@ -603,7 +622,7 @@ calculationMapData); // When - calculationA.InputParameters.ForeshoreProfile = foreshoreProfileB; + calculationA.InputParameters.ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.5, 1.5)); calculationA.InputParameters.NotifyObservers(); // Then @@ -615,25 +634,22 @@ public void GivenViewWithCalculationData_WhenCalculationUpdatedAndNotified_ThenMapDataUpdated() { // Given - using (var view = new StabilityStoneCoverFailureMechanismView()) + var calculationA = new StabilityStoneCoverWaveConditionsCalculation { + InputParameters = + { + ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.3, 1.3)), + HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() + } + }; + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationA); + + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, new ObservableTestAssessmentSectionStub())) + { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var failureMechanism = new StabilityStoneCoverFailureMechanism(); var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - - var foreshoreProfileA = new TestForeshoreProfile(new Point2D(1.3, 1.3)); - - var calculationA = new StabilityStoneCoverWaveConditionsCalculation - { - InputParameters = - { - ForeshoreProfile = foreshoreProfileA, - HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() - } - }; - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationA); - view.Data = failureMechanismContext; var calculationMapData = (MapLineData) map.Data.Collection.ElementAt(calculationsIndex); @@ -663,12 +679,13 @@ const int updatedForeshoreProfilesLayerIndex = foreshoreProfilesIndex - 1; const int updatedCalculationsIndex = calculationsIndex - 1; - using (var view = new StabilityStoneCoverFailureMechanismView()) + var assessmentSection = new ObservableTestAssessmentSectionStub(); + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + + using (var view = new StabilityStoneCoverFailureMechanismView(failureMechanism, assessmentSection)) { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var assessmentSection = new ObservableTestAssessmentSectionStub(); - var failureMechanism = new StabilityStoneCoverFailureMechanism(); var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection); view.Data = failureMechanismContext; @@ -755,7 +772,7 @@ var oldStabilityStoneCoverFailureMechanismContext = new StabilityStoneCoverFailureMechanismContext(new StabilityStoneCoverFailureMechanism(), oldAssessmentSection); var newStabilityStoneCoverFailureMechanismContext = new StabilityStoneCoverFailureMechanismContext(new StabilityStoneCoverFailureMechanism(), newAssessmentSection); - using (var view = new StabilityStoneCoverFailureMechanismView()) + using (var view = new StabilityStoneCoverFailureMechanismView(new StabilityStoneCoverFailureMechanism(), oldAssessmentSection)) { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; @@ -793,6 +810,7 @@ calculation.InputParameters.HydraulicBoundaryLocation.Location }, geometries[0].PointCollections.First()); } + Assert.AreEqual("Berekeningen", mapData.Name); }