Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs =================================================================== diff -u -r16bd8076863c03907abeee60b16704aba1bdb1a0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs (.../ClosingStructuresFailureMechanismView.cs) (revision 16bd8076863c03907abeee60b16704aba1bdb1a0) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs (.../ClosingStructuresFailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -21,7 +21,6 @@ using System.Collections.Generic; using System.Linq; -using System.Net.Mime; using System.Windows.Forms; using Core.Common.Base; using Core.Components.Gis.Data; @@ -134,6 +133,7 @@ calculationObserver.Observable = null; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -149,6 +149,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Ringtoets.ClosingStructures.Forms.Test.csproj =================================================================== diff -u -r888f6cdc81e8fb6d6a5b9baadf6395f209008836 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Ringtoets.ClosingStructures.Forms.Test.csproj (.../Ringtoets.ClosingStructures.Forms.Test.csproj) (revision 888f6cdc81e8fb6d6a5b9baadf6395f209008836) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Ringtoets.ClosingStructures.Forms.Test.csproj (.../Ringtoets.ClosingStructures.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -110,6 +110,10 @@ {5A91174A-FB95-4C9D-9CA5-81C0B8D4361A} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4A06DF0D-5D75-4BAD-A95A-A3DB9B7C4AD5} Core.Components.Gis.Forms @@ -118,6 +122,10 @@ {318ba582-88c9-4816-a54a-a7e431461de3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r000b675444761bd16bc9aa7860c2af198b705bb0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs (.../ClosingStructuresFailureMechanismViewTest.cs) (revision 000b675444761bd16bc9aa7860c2af198b705bb0) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs (.../ClosingStructuresFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using Core.Components.Gis.Geometries; @@ -107,6 +108,31 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using(new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new ClosingStructuresFailureMechanismView()) + { + var failureMechanismContext = new ClosingStructuresFailureMechanismContext( + new ClosingStructuresFailureMechanism(), assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_OtherThanClosingStructuresFailureMechanismContext_DataNull() { // Setup @@ -131,7 +157,7 @@ var mockRepository = new MockRepository(); IAssessmentSection assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); - + var failureMechanismContext = new ClosingStructuresFailureMechanismContext( new ClosingStructuresFailureMechanism(), assessmentSection); @@ -147,6 +173,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); mockRepository.VerifyAll(); } @@ -203,12 +230,11 @@ var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(new[] - { - new Point2D(1.0, 2.0), - new Point2D(2.0, 1.0) - }); + { + new Point2D(1.0, 2.0), + new Point2D(2.0, 1.0) + }); - var mockRepository = new MockRepository(); IAssessmentSection assessmentSection = mockRepository.Stub(); assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; @@ -245,15 +271,15 @@ failureMechanism.AddSection(new FailureMechanismSection("C", geometryPoints.Skip(2).Take(2))); failureMechanism.ForeshoreProfiles.Add(new TestForeshoreProfile(new[] - { - new Point2D(0, 0), - new Point2D(1, 1) - })); + { + new Point2D(0, 0), + new Point2D(1, 1) + })); failureMechanism.ForeshoreProfiles.Add(new TestForeshoreProfile(new[] - { - new Point2D(2, 2), - new Point2D(3, 3) - })); + { + new Point2D(2, 2), + new Point2D(3, 3) + })); failureMechanism.CalculationsGroup.Children.Add(calculationA); failureMechanism.CalculationsGroup.Children.Add(calculationB); @@ -479,10 +505,10 @@ // Call failureMechanism.AddSection(new FailureMechanismSection(string.Empty, new[] - { - new Point2D(1, 2), - new Point2D(1, 2) - })); + { + new Point2D(1, 2), + new Point2D(1, 2) + })); failureMechanism.NotifyObservers(); // Assert @@ -504,10 +530,10 @@ var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); failureMechanism.ForeshoreProfiles.Add(new TestForeshoreProfile(new[] - { - new Point2D(0, 0), - new Point2D(1, 1) - })); + { + new Point2D(0, 0), + new Point2D(1, 1) + })); view.Data = failureMechanismContext; @@ -518,10 +544,10 @@ // Call failureMechanism.ForeshoreProfiles.Add(new TestForeshoreProfile(new[] - { - new Point2D(2, 2), - new Point2D(3, 3) - })); + { + new Point2D(2, 2), + new Point2D(3, 3) + })); failureMechanism.ForeshoreProfiles.NotifyObservers(); // Assert @@ -790,10 +816,10 @@ newAssessmentSection.ReferenceLine = new ReferenceLine(); newAssessmentSection.ReferenceLine.SetGeometry(new[] - { - new Point2D(2, 4), - new Point2D(3, 4) - }); + { + new Point2D(2, 4), + new Point2D(3, 4) + }); var oldClosingStructuresFailureMechanismContext = new ClosingStructuresFailureMechanismContext(new ClosingStructuresFailureMechanism(), oldAssessmentSection); var newClosingStructuresFailureMechanismContext = new ClosingStructuresFailureMechanismContext(new ClosingStructuresFailureMechanism(), newAssessmentSection); @@ -848,10 +874,10 @@ StructuresCalculation calculation = calculationsArray[index]; CollectionAssert.AreEquivalent(new[] - { - calculation.InputParameters.Structure.Location, - calculation.InputParameters.HydraulicBoundaryLocation.Location - }, geometries[0].PointCollections.First()); + { + calculation.InputParameters.Structure.Location, + calculation.InputParameters.HydraulicBoundaryLocation.Location + }, geometries[0].PointCollections.First()); } Assert.AreEqual("Berekeningen", mapData.Name); } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismView.cs (.../FailureMechanismView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismView.cs (.../FailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -103,6 +103,7 @@ mapDataCollection.Name = defaultMapDataCollectionName; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -115,6 +116,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -151,6 +151,10 @@ {5A91174A-FB95-4C9D-9CA5-81C0B8D4361A} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4A06DF0D-5D75-4BAD-A95A-A3DB9B7C4AD5} Core.Components.Gis.Forms @@ -159,6 +163,10 @@ {318BA582-88C9-4816-A54A-A7E431461DE3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {74CBA865-9338-447F-BAD9-28312446AE84} Ringtoets.HydraRing.Calculation.TestUtil Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs =================================================================== diff -u -r3722e29f53ce7db0f11fb184cdc2a76d33078cf2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs (.../FailureMechanismViewTest.cs) (revision 3722e29f53ce7db0f11fb184cdc2a76d33078cf2) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs (.../FailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -93,6 +94,31 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new FailureMechanismView()) + { + var failureMechanism = new TestFailureMechanism(); + var failureMechanismContext = new FailureMechanismContext(failureMechanism, assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_OtherThanFailureMechanismContext_DataNull() { // Setup @@ -105,6 +131,7 @@ // Assert Assert.IsNull(view.Data); + Assert.IsNull(view.Map.BackgroundMapData); } } Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionFailureMechanismView.cs =================================================================== diff -u -rbc0f3d7ae18c5a240f05fd29b62238ca978b40e4 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionFailureMechanismView.cs (.../DuneErosionFailureMechanismView.cs) (revision bc0f3d7ae18c5a240f05fd29b62238ca978b40e4) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionFailureMechanismView.cs (.../DuneErosionFailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -93,6 +93,7 @@ duneLocationsObserver.Observable = null; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -105,6 +106,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj =================================================================== diff -u -r888f6cdc81e8fb6d6a5b9baadf6395f209008836 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj (.../Ringtoets.DuneErosion.Forms.Test.csproj) (revision 888f6cdc81e8fb6d6a5b9baadf6395f209008836) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj (.../Ringtoets.DuneErosion.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -111,6 +111,10 @@ {5A91174A-FB95-4C9D-9CA5-81C0B8D4361A} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4A06DF0D-5D75-4BAD-A95A-A3DB9B7C4AD5} Core.Components.Gis.Forms @@ -119,6 +123,10 @@ {318BA582-88C9-4816-A54A-A7E431461DE3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs =================================================================== diff -u -r000b675444761bd16bc9aa7860c2af198b705bb0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision 000b675444761bd16bc9aa7860c2af198b705bb0) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -118,6 +119,30 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new DuneErosionFailureMechanismView()) + { + var failureMechanismContext = new DuneErosionFailureMechanismContext(new DuneErosionFailureMechanism(), assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_SetToNull_MapDataCleared() { // Setup @@ -140,6 +165,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); mockRepository.VerifyAll(); } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismView.cs (.../GrassCoverErosionInwardsFailureMechanismView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismView.cs (.../GrassCoverErosionInwardsFailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -129,6 +129,7 @@ calculationObserver.Observable = null; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -143,6 +144,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -129,6 +129,10 @@ {5A91174A-FB95-4C9D-9CA5-81C0B8D4361A} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4A06DF0D-5D75-4BAD-A95A-A3DB9B7C4AD5} Core.Components.Gis.Forms @@ -137,6 +141,10 @@ {318BA582-88C9-4816-A54A-A7E431461DE3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs =================================================================== diff -u -r000b675444761bd16bc9aa7860c2af198b705bb0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision 000b675444761bd16bc9aa7860c2af198b705bb0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -119,6 +120,30 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new GrassCoverErosionInwardsFailureMechanismView()) + { + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(new GrassCoverErosionInwardsFailureMechanism(), assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_SetToNull_MapDataCleared() { // Setup @@ -141,6 +166,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); mockRepository.VerifyAll(); } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismView.cs (.../GrassCoverErosionOutwardsFailureMechanismView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismView.cs (.../GrassCoverErosionOutwardsFailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -119,6 +119,7 @@ calculationObserver.Observable = null; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -133,6 +134,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -126,6 +126,10 @@ {5a91174a-fb95-4c9d-9ca5-81c0b8d4361a} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4a06df0d-5d75-4bad-a95a-a3db9b7c4ad5} Core.Components.Gis.Forms @@ -134,6 +138,10 @@ {318ba582-88c9-4816-a54a-a7e431461de3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs =================================================================== diff -u -r000b675444761bd16bc9aa7860c2af198b705bb0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision 000b675444761bd16bc9aa7860c2af198b705bb0) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -117,6 +118,31 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new GrassCoverErosionOutwardsFailureMechanismView()) + { + var failureMechanismContext = new GrassCoverErosionOutwardsFailureMechanismContext( + new GrassCoverErosionOutwardsFailureMechanism(), assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_SetToNull_MapDataCleared() { // Setup @@ -140,6 +166,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); mockRepository.VerifyAll(); } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs =================================================================== diff -u -r4c580b17f584bdfcaae96992b11f90025647ca20 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs (.../HeightStructuresFailureMechanismView.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs (.../HeightStructuresFailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -133,6 +133,7 @@ calculationObserver.Observable = null; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -149,6 +150,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Ringtoets.HeightStructures.Forms.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Ringtoets.HeightStructures.Forms.Test.csproj (.../Ringtoets.HeightStructures.Forms.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Ringtoets.HeightStructures.Forms.Test.csproj (.../Ringtoets.HeightStructures.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -111,6 +111,10 @@ {5A91174A-FB95-4C9D-9CA5-81C0B8D4361A} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4A06DF0D-5D75-4BAD-A95A-A3DB9B7C4AD5} Core.Components.Gis.Forms @@ -119,6 +123,10 @@ {318BA582-88C9-4816-A54A-A7E431461DE3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r000b675444761bd16bc9aa7860c2af198b705bb0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision 000b675444761bd16bc9aa7860c2af198b705bb0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -122,6 +123,31 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new HeightStructuresFailureMechanismView()) + { + var failureMechanismContext = new HeightStructuresFailureMechanismContext( + new HeightStructuresFailureMechanism(), assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_SetToNull_MapDataCleared() { // Setup @@ -145,6 +171,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); mockRepository.VerifyAll(); } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -85,12 +85,14 @@ if (data == null) { Map.Data = null; + Map.BackgroundMapData = null; } else { SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.BackgroundMapData; } } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -r0bf0b88b0ee95f604d7ef5242670371d0da71c38 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 0bf0b88b0ee95f604d7ef5242670371d0da71c38) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -137,6 +137,10 @@ {d749ee4c-ce50-4c17-bf01-9a953028c126} Core.Common.TestUtil + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4a06df0d-5d75-4bad-a95a-a3db9b7c4ad5} Core.Components.Gis.Forms @@ -145,6 +149,10 @@ {318ba582-88c9-4816-a54a-a7e431461de3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {d24fa2f7-28a7-413b-afd3-ee10e985630b} Ringtoets.Common.Forms.TestUtil Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs =================================================================== diff -u -r3722e29f53ce7db0f11fb184cdc2a76d33078cf2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 3722e29f53ce7db0f11fb184cdc2a76d33078cf2) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -23,6 +23,7 @@ using System.Linq; using System.Windows.Forms; using Core.Common.Base.Geometry; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -100,6 +101,28 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new AssessmentSectionView()) + { + // Call + view.Data = assessmentSection; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_SetToNull_MapDataCleared() { // Setup @@ -117,6 +140,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -137,6 +137,10 @@ {5A91174A-FB95-4C9D-9CA5-81C0B8D4361A} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4a06df0d-5d75-4bad-a95a-a3db9b7c4ad5} Core.Components.Gis.Forms @@ -145,6 +149,10 @@ {318ba582-88c9-4816-a54a-a7e431461de3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -r16bd8076863c03907abeee60b16704aba1bdb1a0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 16bd8076863c03907abeee60b16704aba1bdb1a0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -23,9 +23,9 @@ using System.Collections.ObjectModel; using System.Linq; using System.Windows.Forms; -using Core.Common.Base; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -155,15 +155,13 @@ public void Data_EmptyPipingFailureMechanismContext_NoMapDataSet() { // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); var backgroundMapData = WmtsMapData.CreateUnconnectedMapData(); - assessmentSection.Stub(s => s.BackgroundMapData).Return(backgroundMapData); - assessmentSection.Stub(s => s.Id).Return("A"); - assessmentSection.Stub(s => s.Attach(Arg.Is.NotNull)); - assessmentSection.Stub(s => s.Detach(Arg.Is.NotNull)); - mocks.ReplayAll(); + var assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + using (var view = new PipingFailureMechanismView()) { var failureMechanismContext = new PipingFailureMechanismContext( @@ -177,7 +175,6 @@ AssertEmptyMapData(view.Map.Data); Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); } - mocks.VerifyAll(); } [Test] @@ -188,14 +185,13 @@ WmtsMapData backgroundMapData = isConfigured ? WmtsMapData.CreateAlternativePdokMapData() : WmtsMapData.CreateUnconnectedMapData(); var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - assessmentSection.Stub(s => s.BackgroundMapData).Return(backgroundMapData); - assessmentSection.Stub(s => s.Id).Return("A"); - assessmentSection.Stub(s => s.Attach(Arg.Is.NotNull)); - assessmentSection.Stub(s => s.Detach(Arg.Is.NotNull)); - mocks.ReplayAll(); + var assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; // Setup + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) using (var view = new PipingFailureMechanismView()) { var failureMechanismContext = new PipingFailureMechanismContext(new PipingFailureMechanism(), assessmentSection); @@ -213,14 +209,13 @@ public void Data_SetToNull_ClearMapDataProperties() { // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - assessmentSection.Stub(s => s.BackgroundMapData).Return(WmtsMapData.CreateUnconnectedMapData()); - assessmentSection.Stub(s => s.Id).Return("A"); - assessmentSection.Stub(s => s.Attach(Arg.Is.NotNull)); - assessmentSection.Stub(s => s.Detach(Arg.Is.NotNull)); - mocks.ReplayAll(); + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + var assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) using (var view = new PipingFailureMechanismView()) { view.Data = new PipingFailureMechanismContext( @@ -237,7 +232,6 @@ Assert.IsNull(view.Map.Data); Assert.IsNull(view.Map.BackgroundMapData); } - mocks.VerifyAll(); } [Test] Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs =================================================================== diff -u -r4c580b17f584bdfcaae96992b11f90025647ca20 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs (.../StabilityPointStructuresFailureMechanismView.cs) (revision 4c580b17f584bdfcaae96992b11f90025647ca20) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs (.../StabilityPointStructuresFailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -133,6 +133,7 @@ calculationObserver.Observable = null; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -148,6 +149,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj (.../Ringtoets.StabilityPointStructures.Forms.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj (.../Ringtoets.StabilityPointStructures.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -110,6 +110,10 @@ {5A91174A-FB95-4C9D-9CA5-81C0B8D4361A} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4A06DF0D-5D75-4BAD-A95A-A3DB9B7C4AD5} Core.Components.Gis.Forms @@ -118,6 +122,10 @@ {318BA582-88C9-4816-A54A-A7E431461DE3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r000b675444761bd16bc9aa7860c2af198b705bb0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision 000b675444761bd16bc9aa7860c2af198b705bb0) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -122,6 +123,31 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new StabilityPointStructuresFailureMechanismView()) + { + var failureMechanismContext = new StabilityPointStructuresFailureMechanismContext( + new StabilityPointStructuresFailureMechanism(), assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_SetToNull_MapDataCleared() { // Setup @@ -145,6 +171,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); mockRepository.VerifyAll(); } Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs (.../StabilityStoneCoverFailureMechanismView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs (.../StabilityStoneCoverFailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -127,6 +127,7 @@ calculationObserver.Observable = null; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -141,6 +142,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj (.../Ringtoets.StabilityStoneCover.Forms.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj (.../Ringtoets.StabilityStoneCover.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -118,6 +118,10 @@ {5a91174a-fb95-4c9d-9ca5-81c0b8d4361a} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4a06df0d-5d75-4bad-a95a-a3db9b7c4ad5} Core.Components.Gis.Forms @@ -126,6 +130,10 @@ {318ba582-88c9-4816-a54a-a7e431461de3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs =================================================================== diff -u -r000b675444761bd16bc9aa7860c2af198b705bb0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 000b675444761bd16bc9aa7860c2af198b705bb0) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -118,6 +119,31 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new StabilityStoneCoverFailureMechanismView()) + { + var failureMechanismContext = new StabilityStoneCoverFailureMechanismContext( + new StabilityStoneCoverFailureMechanism(), assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_SetToNull_MapDataCleared() { // Setup @@ -141,6 +167,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); mockRepository.VerifyAll(); } Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismView.cs =================================================================== diff -u -r2cafb330e0b90d1103bc9329eafbcba24836787f -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismView.cs (.../WaveImpactAsphaltCoverFailureMechanismView.cs) (revision 2cafb330e0b90d1103bc9329eafbcba24836787f) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismView.cs (.../WaveImpactAsphaltCoverFailureMechanismView.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -127,6 +127,7 @@ calculationObserver.Observable = null; Map.Data = null; + Map.BackgroundMapData = null; } else { @@ -141,6 +142,7 @@ SetMapDataFeatures(); Map.Data = mapDataCollection; + Map.BackgroundMapData = data.Parent.BackgroundMapData; } } } Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj =================================================================== diff -u -r6a5d7b40b7ba4dcb73e393075338352d194e97c2 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj) (revision 6a5d7b40b7ba4dcb73e393075338352d194e97c2) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Forms.Test.csproj) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -107,6 +107,10 @@ {5A91174A-FB95-4C9D-9CA5-81C0B8D4361A} Core.Components.DotSpatial.Forms + + {aa47e858-a2a7-470e-8b2d-c76ae8ed9ccd} + Core.Components.DotSpatial + {4a06df0d-5d75-4bad-a95a-a3db9b7c4ad5} Core.Components.Gis.Forms @@ -115,6 +119,10 @@ {318ba582-88c9-4816-a54a-a7e431461de3} Core.Components.Gis + + {9b6f3987-eaf7-4733-80c1-3dcab44d87ae} + Core.Components.DotSpatial.TestUtil + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs =================================================================== diff -u -r000b675444761bd16bc9aa7860c2af198b705bb0 -r737cd3675ab5bc1b6400e4a0b86ebd543eaee650 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision 000b675444761bd16bc9aa7860c2af198b705bb0) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision 737cd3675ab5bc1b6400e4a0b86ebd543eaee650) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.Geometry; using Core.Components.DotSpatial.Forms; +using Core.Components.DotSpatial.TestUtil; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; using NUnit.Framework; @@ -118,6 +119,31 @@ } [Test] + public void Data_AssessmentSectionWithBackgroundMapData_BackgroundMapDataSet() + { + // Setup + WmtsMapData backgroundMapData = WmtsMapData.CreateDefaultPdokMapData(); + + IAssessmentSection assessmentSection = new ObservableTestAssessmentSectionStub + { + BackgroundMapData = backgroundMapData + }; + + using (new UseCustomTileSourceFactoryConfig(backgroundMapData)) + using (var view = new WaveImpactAsphaltCoverFailureMechanismView()) + { + var failureMechanismContext = new WaveImpactAsphaltCoverFailureMechanismContext( + new WaveImpactAsphaltCoverFailureMechanism(), assessmentSection); + + // Call + view.Data = failureMechanismContext; + + // Assert + Assert.AreSame(backgroundMapData, view.Map.BackgroundMapData); + } + } + + [Test] public void Data_SetToNull_MapDataCleared() { // Setup @@ -141,6 +167,7 @@ // Assert Assert.IsNull(view.Data); Assert.IsNull(view.Map.Data); + Assert.IsNull(view.Map.BackgroundMapData); mockRepository.VerifyAll(); }