Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -117,14 +117,14 @@ targetConfiguration.SelectedCapabilityIdentifier, targetConfiguration.PreferredFormat); - demoAssessmentSection.BackgroundMapData2.Name = targetConfiguration.Name; - demoAssessmentSection.BackgroundMapData2.BackgroundMapDataType = BackgroundMapDataType.Wmts; - demoAssessmentSection.BackgroundMapData2.IsVisible = targetConfiguration.IsVisible; - demoAssessmentSection.BackgroundMapData2.Transparency = targetConfiguration.Transparency; - demoAssessmentSection.BackgroundMapData2.IsConfigured = targetConfiguration.IsConfigured; - demoAssessmentSection.BackgroundMapData2.Parameters.Add("SourceCapabilitiesUrl", targetConfiguration.SourceCapabilitiesUrl); - demoAssessmentSection.BackgroundMapData2.Parameters.Add("SelectedCapabilityIdentifier", targetConfiguration.SelectedCapabilityIdentifier); - demoAssessmentSection.BackgroundMapData2.Parameters.Add("PreferredFormat", targetConfiguration.PreferredFormat); + demoAssessmentSection.BackgroundData.Name = targetConfiguration.Name; + demoAssessmentSection.BackgroundData.BackgroundMapDataType = BackgroundMapDataType.Wmts; + demoAssessmentSection.BackgroundData.IsVisible = targetConfiguration.IsVisible; + demoAssessmentSection.BackgroundData.Transparency = targetConfiguration.Transparency; + demoAssessmentSection.BackgroundData.IsConfigured = targetConfiguration.IsConfigured; + demoAssessmentSection.BackgroundData.Parameters.Add("SourceCapabilitiesUrl", targetConfiguration.SourceCapabilitiesUrl); + demoAssessmentSection.BackgroundData.Parameters.Add("SelectedCapabilityIdentifier", targetConfiguration.SelectedCapabilityIdentifier); + demoAssessmentSection.BackgroundData.Parameters.Add("PreferredFormat", targetConfiguration.PreferredFormat); } private void InitializeDemoReferenceLine(AssessmentSection demoAssessmentSection) Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs (.../ClosingStructuresFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismView.cs (.../ClosingStructuresFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -152,11 +152,11 @@ calculationGroupObserver.Observable = data.WrappedData.CalculationsGroup; calculationObserver.Observable = data.WrappedData.CalculationsGroup; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -192,7 +192,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs (.../ClosingStructuresFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs (.../ClosingStructuresFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -117,7 +117,7 @@ view.Data = failureMechanismContext; // Assert - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundMapData2); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -184,7 +184,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -434,19 +434,19 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); view.Data = new ClosingStructuresFailureMechanismContext(new ClosingStructuresFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundData.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundData.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundData.cs (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -0,0 +1,71 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Collections.Generic; +using Core.Common.Base; +using Core.Common.Base.Data; + +namespace Ringtoets.Common.Data.AssessmentSection +{ + /// + /// Class that holds information about configured background data. + /// + public class BackgroundData : Observable + + { + /// + /// Creates a new . + /// + public BackgroundData() + { + IsVisible = true; + Transparency = new RoundedDouble(2); + Parameters = new Dictionary(); + } + + public string Name { get; set; } + + /// + /// Gets or sets a value indicating whether the background is visible. + /// + public bool IsVisible { get; set; } + + /// + /// Gets or sets the transparency of the background. + /// + public RoundedDouble Transparency { get; set; } + + /// + /// Gets or sets the type of the background map data. + /// + public BackgroundMapDataType BackgroundMapDataType { get; set; } + + /// + /// Gets or sets whether a background map data is configured. + /// + public bool IsConfigured { get; set; } + + /// + /// Gets the parameters that are configured for a background map data. + /// + public IDictionary Parameters { get; } + } +} \ No newline at end of file Fisheye: Tag 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundMapData.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundMapDataType.cs =================================================================== diff -u -r7342bdbb53114c7b63144219a8fa9df9a097192a -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundMapDataType.cs (.../BackgroundMapDataType.cs) (revision 7342bdbb53114c7b63144219a8fa9df9a097192a) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundMapDataType.cs (.../BackgroundMapDataType.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -22,7 +22,7 @@ namespace Ringtoets.Common.Data.AssessmentSection { /// - /// Enumeration that defines the possible types of a . + /// Enumeration that defines the possible types of a . /// public enum BackgroundMapDataType { Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/IAssessmentSection.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/IAssessmentSection.cs (.../IAssessmentSection.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/IAssessmentSection.cs (.../IAssessmentSection.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -76,7 +76,7 @@ /// BackgroundMapDataContainer BackgroundMapData { get; } - BackgroundMapData BackgroundMapData2 { get; } + BackgroundData BackgroundData { get; } /// /// Gets the failure mechanisms corresponding to the assessment section. Index: Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj =================================================================== diff -u -r7342bdbb53114c7b63144219a8fa9df9a097192a -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 7342bdbb53114c7b63144219a8fa9df9a097192a) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -39,7 +39,7 @@ Properties\GlobalAssembly.cs - + Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismView.cs (.../FailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismView.cs (.../FailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -119,11 +119,11 @@ mapDataCollection.Name = data.WrappedData.Name; hydraulicBoundaryDatabaseObserver.Observable = data.Parent.HydraulicBoundaryDatabase; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -154,7 +154,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsBackgroundMapDataFactory.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsBackgroundMapDataFactory.cs (.../RingtoetsBackgroundMapDataFactory.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsBackgroundMapDataFactory.cs (.../RingtoetsBackgroundMapDataFactory.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -31,23 +31,23 @@ public static class RingtoetsBackgroundMapDataFactory { /// - /// Creates from a . + /// Creates from a . /// - /// The to create + /// The to create /// the for. /// The created . - /// Thrown when + /// Thrown when /// is null. - public static WmtsMapData CreateBackgroundMapData(BackgroundMapData backgroundMapData) + public static WmtsMapData CreateBackgroundMapData(BackgroundData backgroundData) { - if (backgroundMapData == null) + if (backgroundData == null) { - throw new ArgumentNullException(nameof(backgroundMapData)); + throw new ArgumentNullException(nameof(backgroundData)); } - if (backgroundMapData.BackgroundMapDataType == BackgroundMapDataType.Wmts) + if (backgroundData.BackgroundMapDataType == BackgroundMapDataType.Wmts) { - return CreateWmtsBackgroundMapData(backgroundMapData); + return CreateWmtsBackgroundMapData(backgroundData); } return null; @@ -57,24 +57,24 @@ /// Updates an existing . /// /// The to update. - /// The used + /// The used /// to update the map data. /// The updated . /// Thrown when any parameter is null. - public static void UpdateBackgroundMapData(WmtsMapData mapData, BackgroundMapData backgroundMapData) + public static void UpdateBackgroundMapData(WmtsMapData mapData, BackgroundData backgroundData) { if (mapData == null) { throw new ArgumentNullException(nameof(mapData)); } - if (backgroundMapData == null) + if (backgroundData == null) { - throw new ArgumentNullException(nameof(backgroundMapData)); + throw new ArgumentNullException(nameof(backgroundData)); } - if (backgroundMapData.BackgroundMapDataType == BackgroundMapDataType.Wmts) + if (backgroundData.BackgroundMapDataType == BackgroundMapDataType.Wmts) { - WmtsMapData newMapData = CreateWmtsBackgroundMapData(backgroundMapData); + WmtsMapData newMapData = CreateWmtsBackgroundMapData(backgroundData); if (newMapData.IsConfigured) { @@ -93,7 +93,7 @@ } } - private static WmtsMapData CreateWmtsBackgroundMapData(BackgroundMapData backgroundData) + private static WmtsMapData CreateWmtsBackgroundMapData(BackgroundData backgroundData) { WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); mapData.Name = backgroundData.Name; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/BackgroundDataTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/BackgroundDataTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/BackgroundDataTest.cs (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; +using Ringtoets.Common.Data.AssessmentSection; + +namespace Ringtoets.Common.Data.Test.AssessmentSection +{ + [TestFixture] + public class BackgroundDataTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var backgroundMapData = new BackgroundData(); + + // Assert + Assert.IsTrue(backgroundMapData.IsVisible); + Assert.AreEqual(2, backgroundMapData.Transparency.NumberOfDecimalPlaces); + Assert.AreEqual(0, backgroundMapData.Transparency.Value); + Assert.AreEqual(BackgroundMapDataType.Wmts, backgroundMapData.BackgroundMapDataType); + Assert.IsFalse(backgroundMapData.IsConfigured); + CollectionAssert.IsEmpty(backgroundMapData.Parameters); + } + } +} \ No newline at end of file Fisheye: Tag 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/BackgroundMapDataTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj =================================================================== diff -u -r709931efbca2f60911829a07dc275f19b2ad0af0 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision 709931efbca2f60911829a07dc275f19b2ad0af0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -55,7 +55,7 @@ Properties\GlobalAssembly.cs - + Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/ObservableTestAssessmentSectionStubTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/ObservableTestAssessmentSectionStubTest.cs (.../ObservableTestAssessmentSectionStubTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/ObservableTestAssessmentSectionStubTest.cs (.../ObservableTestAssessmentSectionStubTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -50,8 +50,8 @@ Assert.IsNull(assessmentSection.ReferenceLine); Assert.IsNull(assessmentSection.HydraulicBoundaryDatabase); Assert.IsNull(assessmentSection.BackgroundMapData.MapData); - Assert.IsNotNull(assessmentSection.BackgroundMapData2); - Assert.AreEqual("Background data", assessmentSection.BackgroundMapData2.Name); + Assert.IsNotNull(assessmentSection.BackgroundData); + Assert.AreEqual("Background data", assessmentSection.BackgroundData.Name); Assert.AreEqual(1.0 / 300000.0, assessmentSection.FailureMechanismContribution.Norm); FailureMechanismContributionItem[] contributionItems = assessmentSection.FailureMechanismContribution.Distribution.ToArray(); Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/BackgroundMapDataTestDataGenerator.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/BackgroundMapDataTestDataGenerator.cs (.../BackgroundMapDataTestDataGenerator.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/BackgroundMapDataTestDataGenerator.cs (.../BackgroundMapDataTestDataGenerator.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -26,9 +26,9 @@ { public static class BackgroundMapDataTestDataGenerator { - public static BackgroundMapData GetWmtsBackgroundMapData(WmtsMapData wmtsMapData) + public static BackgroundData GetWmtsBackgroundMapData(WmtsMapData wmtsMapData) { - var backgroundMapData = new BackgroundMapData + var backgroundMapData = new BackgroundData { Name = wmtsMapData.Name, IsVisible = wmtsMapData.IsVisible, @@ -47,9 +47,9 @@ return backgroundMapData; } - public static BackgroundMapData GetWellKnownBackgroundMapData() + public static BackgroundData GetWellKnownBackgroundMapData() { - return new BackgroundMapData + return new BackgroundData { BackgroundMapDataType = BackgroundMapDataType.WellKnown }; Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/ObservableTestAssessmentSectionStub.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/ObservableTestAssessmentSectionStub.cs (.../ObservableTestAssessmentSectionStub.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/ObservableTestAssessmentSectionStub.cs (.../ObservableTestAssessmentSectionStub.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -41,7 +41,7 @@ { FailureMechanismContribution = new FailureMechanismContribution(Enumerable.Empty(), 0, 1.0 / 300000); BackgroundMapData = new BackgroundMapDataContainer(); - BackgroundMapData2 = new BackgroundMapData + BackgroundData = new BackgroundData { Name = "Background data" }; @@ -55,7 +55,7 @@ public FailureMechanismContribution FailureMechanismContribution { get; } public HydraulicBoundaryDatabase HydraulicBoundaryDatabase { get; set; } public BackgroundMapDataContainer BackgroundMapData { get; } - public BackgroundMapData BackgroundMapData2 { get; } + public BackgroundData BackgroundData { get; } public IEnumerable GetFailureMechanisms() { Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs (.../FailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs (.../FailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -107,7 +107,7 @@ view.Data = failureMechanismContext; // Assert - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundMapData2); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -167,7 +167,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -375,19 +375,19 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); view.Data = new FailureMechanismContext(new TestFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsBackgroundMapDataFactoryTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsBackgroundMapDataFactoryTest.cs (.../RingtoetsBackgroundMapDataFactoryTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsBackgroundMapDataFactoryTest.cs (.../RingtoetsBackgroundMapDataFactoryTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -47,10 +47,10 @@ public void CreateBackgroundMapData_BackgroundMapDataTypeWellKnown_ReturnNull() { // Setup - BackgroundMapData backgroundMapData = BackgroundMapDataTestDataGenerator.GetWellKnownBackgroundMapData(); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWellKnownBackgroundMapData(); // Call - WmtsMapData mapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData mapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); // Assert Assert.IsNull(mapData); @@ -61,10 +61,10 @@ { // Setup WmtsMapData wmtsMapData = WmtsMapData.CreateDefaultPdokMapData(); - BackgroundMapData backgroundMapData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(wmtsMapData); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(wmtsMapData); // Call - WmtsMapData mapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData mapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); // Assert Assert.AreEqual(wmtsMapData.Name, mapData.Name); @@ -81,10 +81,10 @@ { // Setup WmtsMapData wmtsMapData = WmtsMapData.CreateUnconnectedMapData(); - BackgroundMapData backgroundMapData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(wmtsMapData); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(wmtsMapData); // Call - WmtsMapData mapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData mapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); // Assert Assert.AreEqual(wmtsMapData.Name, mapData.Name); @@ -100,7 +100,7 @@ public void UpdateBackgroundMapData_WmtsMapDataNull_ThrowArgumentNullException() { // Call - TestDelegate test = () => RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(null, new BackgroundMapData()); + TestDelegate test = () => RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(null, new BackgroundData()); // Assert var exception = Assert.Throws(test); @@ -123,18 +123,18 @@ { // Setup WmtsMapData wmtsMapData = WmtsMapData.CreateDefaultPdokMapData(); - BackgroundMapData backgroundMapData = BackgroundMapDataTestDataGenerator.GetWellKnownBackgroundMapData(); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWellKnownBackgroundMapData(); string originalName = wmtsMapData.Name; bool originalVisibility = wmtsMapData.IsVisible; RoundedDouble originalTransparancy = wmtsMapData.Transparency; - backgroundMapData.Name = "new name"; - backgroundMapData.IsVisible = true; - backgroundMapData.Transparency = (RoundedDouble) 0.4; + backgroundData.Name = "new name"; + backgroundData.IsVisible = true; + backgroundData.Transparency = (RoundedDouble) 0.4; // Call - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(wmtsMapData, backgroundMapData); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(wmtsMapData, backgroundData); // Assert Assert.AreEqual(originalName, wmtsMapData.Name); @@ -147,18 +147,18 @@ { // Setup WmtsMapData wmtsMapData = WmtsMapData.CreateDefaultPdokMapData(); - BackgroundMapData backgroundMapData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(wmtsMapData); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(wmtsMapData); - string originalSourceCapabilitiesUrl = backgroundMapData.Parameters["SourceCapabilitiesUrl"]; - string originalSelectedCapabilityIdentifier = backgroundMapData.Parameters["SelectedCapabilityIdentifier"]; - string originalPreferredFormat = backgroundMapData.Parameters["PreferredFormat"]; + string originalSourceCapabilitiesUrl = backgroundData.Parameters["SourceCapabilitiesUrl"]; + string originalSelectedCapabilityIdentifier = backgroundData.Parameters["SelectedCapabilityIdentifier"]; + string originalPreferredFormat = backgroundData.Parameters["PreferredFormat"]; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some/url"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/format"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some/url"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/format"; // Call - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(wmtsMapData, backgroundMapData); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(wmtsMapData, backgroundData); // Assert Assert.AreNotEqual(originalSourceCapabilitiesUrl, wmtsMapData.SourceCapabilitiesUrl); @@ -171,16 +171,16 @@ { // Given WmtsMapData wmtsMapData = WmtsMapData.CreateDefaultPdokMapData(); - BackgroundMapData backgroundMapData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(wmtsMapData); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(wmtsMapData); // Precondition Assert.IsNotNull(wmtsMapData.SourceCapabilitiesUrl); Assert.IsNotNull(wmtsMapData.SelectedCapabilityIdentifier); Assert.IsNotNull(wmtsMapData.PreferredFormat); // When - backgroundMapData.IsConfigured = false; - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(wmtsMapData, backgroundMapData); + backgroundData.IsConfigured = false; + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(wmtsMapData, backgroundData); // Then Assert.IsNull(wmtsMapData.SourceCapabilitiesUrl); Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionFailureMechanismView.cs (.../DuneErosionFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionFailureMechanismView.cs (.../DuneErosionFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -109,11 +109,11 @@ mapDataCollection.Name = data.WrappedData.Name; duneLocationsObserver.Observable = data.WrappedData.DuneLocations; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -144,7 +144,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -127,7 +127,7 @@ view.Data = failureMechanismContext; // Assert - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundMapData2); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -174,7 +174,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -353,19 +353,19 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); view.Data = new DuneErosionFailureMechanismContext(new DuneErosionFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismView.cs (.../GrassCoverErosionInwardsFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismView.cs (.../GrassCoverErosionInwardsFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -147,11 +147,11 @@ calculationGroupObserver.Observable = data.WrappedData.CalculationsGroup; calculationObserver.Observable = data.WrappedData.CalculationsGroup; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -186,7 +186,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -128,7 +128,7 @@ view.Data = failureMechanismContext; // Assert - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundMapData2); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -175,7 +175,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -421,19 +421,19 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); view.Data = new GrassCoverErosionInwardsFailureMechanismContext(new GrassCoverErosionInwardsFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismView.cs (.../GrassCoverErosionOutwardsFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismView.cs (.../GrassCoverErosionOutwardsFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -137,11 +137,11 @@ calculationGroupObserver.Observable = data.WrappedData.WaveConditionsCalculationGroup; calculationObserver.Observable = data.WrappedData.WaveConditionsCalculationGroup; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -176,7 +176,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -127,7 +127,7 @@ view.Data = failureMechanismContext; // Assert - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundMapData2); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -176,7 +176,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -315,19 +315,19 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); view.Data = new GrassCoverErosionOutwardsFailureMechanismContext(new GrassCoverErosionOutwardsFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs (.../HeightStructuresFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismView.cs (.../HeightStructuresFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -153,11 +153,11 @@ calculationGroupObserver.Observable = data.WrappedData.CalculationsGroup; calculationObserver.Observable = data.WrappedData.CalculationsGroup; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -193,7 +193,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -132,7 +132,7 @@ view.Data = failureMechanismContext; // Assert - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundMapData2); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -181,7 +181,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -431,19 +431,19 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); view.Data = new HeightStructuresFailureMechanismContext(new HeightStructuresFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -69,7 +69,7 @@ MapData = mapData }; - BackgroundMapData2 = new BackgroundMapData + BackgroundData = new BackgroundData { IsVisible = mapData.IsVisible, Transparency = mapData.Transparency, @@ -221,7 +221,7 @@ public BackgroundMapDataContainer BackgroundMapData { get; } - public BackgroundMapData BackgroundMapData2 { get; } + public BackgroundData BackgroundData { get; } public IEnumerable GetFailureMechanisms() { Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/BackgroundDataProperties.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/BackgroundDataProperties.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/BackgroundDataProperties.cs (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -0,0 +1,171 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Data; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Integration.Forms.Properties; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; +using GisFormsResources = Core.Components.Gis.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// ViewModel of the for properties panel. + /// + public class BackgroundDataProperties : ObjectProperties + { + /// + /// Creates a new instance of . + /// + /// The data for which the properties are shown. + /// Thrown when + /// is null. + public BackgroundDataProperties(BackgroundData backgroundData) + { + if (backgroundData == null) + { + throw new ArgumentNullException(nameof(backgroundData)); + } + + Data = backgroundData; + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.BackgroundMapDataContainerProperties_Name_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundMapDataContainerProperties_Name_Description))] + public string Name + { + get + { + return data.IsConfigured ? data.Name : string.Empty; + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.BackgroundMapDataContainerProperties_Transparency_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundMapDataContainerProperties_Transparency_Description))] + public RoundedDouble Transparency + { + get + { + return data.Transparency; + } + set + { + data.Transparency = value; + data.NotifyObservers(); + } + } + + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.BackgroundMapDataContainerProperties_IsVisible_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundMapDataContainerProperties_IsVisible_Description))] + public bool IsVisible + { + get + { + return data.IsVisible; + } + set + { + data.IsVisible = value; + data.NotifyObservers(); + } + } + + [DynamicVisibleValidationMethod] + public bool DynamicVisibleValidationMethod(string propertyName) + { + return data.IsConfigured + && data.BackgroundMapDataType == BackgroundMapDataType.Wmts + && WmtsProperties.Contains(propertyName); + } + + #region Wmts MapData + + [DynamicVisible] + [ResourcesCategory(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_WMTS_Category))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_Url_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_Url_Description))] + public string SourceCapabilitiesUrl + { + get + { + return GetBackgroundMapDataParameter(data, nameof(SourceCapabilitiesUrl)); + } + } + + [DynamicVisible] + [ResourcesCategory(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_WMTS_Category))] + [ResourcesDisplayName(typeof(GisFormsResources), nameof(GisFormsResources.WmtsCapability_MapLayer_Id))] + [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_SelectedCapabilityIdentifier_Description))] + public string SelectedCapabilityIdentifier + { + get + { + return GetBackgroundMapDataParameter(data, nameof(SelectedCapabilityIdentifier)); + } + } + + [DynamicVisible] + [ResourcesCategory(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_WMTS_Category))] + [ResourcesDisplayName(typeof(GisFormsResources), nameof(GisFormsResources.WmtsCapability_MapLayer_Format))] + [ResourcesDescription(typeof(Resources), nameof(Resources.BackgroundWmtsMapDataContainerProperties_PreferredFormat_Description))] + public string PreferredFormat + { + get + { + return GetBackgroundMapDataParameter(data, nameof(PreferredFormat)); + } + } + + private string GetBackgroundMapDataParameter(BackgroundData backgroundData, string parameterName) + { + if (backgroundData.IsConfigured + && backgroundData.BackgroundMapDataType == BackgroundMapDataType.Wmts + && WmtsProperties.Contains(parameterName) + && backgroundData.Parameters.ContainsKey(parameterName)) + { + return backgroundData.Parameters[parameterName]; + } + + return string.Empty; + } + + private IEnumerable WmtsProperties + { + get + { + yield return nameof(SourceCapabilitiesUrl); + yield return nameof(SelectedCapabilityIdentifier); + yield return nameof(PreferredFormat); + } + } + + #endregion + } +} \ No newline at end of file Fisheye: Tag 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/BackgroundMapDataProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -60,7 +60,7 @@ - + Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -85,7 +85,7 @@ assessmentSectionObserver.Observable = data; hydraulicBoundaryDatabaseObserver.Observable = data?.HydraulicBoundaryDatabase; - backgroundMapDataObserver.Observable = data?.BackgroundMapData2; + backgroundMapDataObserver.Observable = data?.BackgroundData; if (data == null) { @@ -96,7 +96,7 @@ { SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -126,7 +126,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -r70952faba3713dc603266d3a2bc9c00eb4397caf -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 70952faba3713dc603266d3a2bc9c00eb4397caf) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -1,25 +1,4 @@ -// Copyright (C) Stichting Deltares 2016. All rights reserved. -// -// This file is part of Ringtoets. -// -// Ringtoets is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// All names, logos, and references to "Deltares" are registered trademarks of -// Stichting Deltares and remain full property of Stichting Deltares at all times. -// All rights reserved. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -106,18 +85,18 @@ /// /// Looks up a localized string similar to Selecteren.... /// - public static string BackgroundMapData_SelectMapData { + public static string BackgroundData_SelectMapData { get { - return ResourceManager.GetString("BackgroundMapData_SelectMapData", resourceCulture); + return ResourceManager.GetString("BackgroundData_SelectMapData", resourceCulture); } } /// /// Looks up a localized string similar to Selecteer een achtergrondkaart.. /// - public static string BackgroundMapData_SelectMapData_Tooltip { + public static string BackgroundData_SelectMapData_Tooltip { get { - return ResourceManager.GetString("BackgroundMapData_SelectMapData_Tooltip", resourceCulture); + return ResourceManager.GetString("BackgroundData_SelectMapData_Tooltip", resourceCulture); } } @@ -222,9 +201,9 @@ /// /// Looks up a localized string similar to Achtergrondkaart. /// - public static string RingtoetsPlugin_BackgroundMapDataContext_Text { + public static string RingtoetsPlugin_BackgroundDataContext_Text { get { - return ResourceManager.GetString("RingtoetsPlugin_BackgroundMapDataContext_Text", resourceCulture); + return ResourceManager.GetString("RingtoetsPlugin_BackgroundDataContext_Text", resourceCulture); } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx =================================================================== diff -u -r70952faba3713dc603266d3a2bc9c00eb4397caf -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 70952faba3713dc603266d3a2bc9c00eb4397caf) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -158,7 +158,7 @@ Weet u zeker dat u wilt doorgaan? - + Achtergrondkaart @@ -169,10 +169,10 @@ Weet u zeker dat u wilt doorgaan? - + Selecteren... - + Selecteer een achtergrondkaart. \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -36,7 +36,6 @@ using Core.Common.Gui.Plugin; using Core.Common.IO.Exceptions; using Core.Common.Utils.Extensions; -using Core.Components.Gis; using Core.Components.Gis.Data; using log4net; using Ringtoets.ClosingStructures.Data; @@ -268,15 +267,15 @@ } /// - /// Returns all instances provided for data of . + /// Returns all instances provided for data of . /// public override IEnumerable GetPropertyInfos() { yield return new PropertyInfo(); yield return new PropertyInfo(); - yield return new PropertyInfo + yield return new PropertyInfo { - CreateInstance = container => new BackgroundMapDataProperties(container) + CreateInstance = container => new BackgroundDataProperties(container) }; yield return new PropertyInfo(); yield return new PropertyInfo @@ -514,11 +513,11 @@ OnNodeRemoved = AssessmentSectionOnNodeRemoved }; - yield return new TreeNodeInfo + yield return new TreeNodeInfo { - Text = container => RingtoetsIntegrationPluginResources.RingtoetsPlugin_BackgroundMapDataContext_Text, + Text = container => RingtoetsIntegrationPluginResources.RingtoetsPlugin_BackgroundDataContext_Text, Image = container => RingtoetsFormsResources.Map, - ContextMenuStrip = BackgroundMapDataMenuStrip, + ContextMenuStrip = BackgroundDataMenuStrip, ForeColor = data => data.IsConfigured ? Color.FromKnownColor(KnownColor.ControlText) : Color.FromKnownColor(KnownColor.GrayText) @@ -883,15 +882,15 @@ } } - #region BackgroundMapData treeNodeInfo + #region BackgroundData treeNodeInfo - private ContextMenuStrip BackgroundMapDataMenuStrip(BackgroundMapData nodeData, object parentData, TreeViewControl treeViewControl) + private ContextMenuStrip BackgroundDataMenuStrip(BackgroundData nodeData, object parentData, TreeViewControl treeViewControl) { var assessmentSection = parentData as IAssessmentSection; var mapDataItem = new StrictContextMenuItem( - RingtoetsIntegrationPluginResources.BackgroundMapData_SelectMapData, - RingtoetsIntegrationPluginResources.BackgroundMapData_SelectMapData_Tooltip, + RingtoetsIntegrationPluginResources.BackgroundData_SelectMapData, + RingtoetsIntegrationPluginResources.BackgroundData_SelectMapData_Tooltip, RingtoetsCommonFormsResources.MapsIcon, (sender, args) => { SelectMapData(assessmentSection, nodeData); }); return Gui.Get(nodeData, treeViewControl) @@ -900,14 +899,14 @@ .Build(); } - private void SelectMapData(IAssessmentSection assessmentSection, BackgroundMapData backgroundMapData) + private void SelectMapData(IAssessmentSection assessmentSection, BackgroundData backgroundData) { if (assessmentSection == null) { return; } - WmtsMapData currentData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData currentData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); using (var dialog = new BackgroundMapDataSelectionDialog(Gui.MainWindow, currentData)) { if (dialog.ShowDialog() == DialogResult.OK) @@ -919,27 +918,27 @@ private static void SetSelectedMapData(IAssessmentSection assessmentSection, ImageBasedMapData selectedMapData) { - assessmentSection.BackgroundMapData2.Name = string.Empty; - assessmentSection.BackgroundMapData2.IsVisible = false; - assessmentSection.BackgroundMapData2.Parameters.Clear(); + assessmentSection.BackgroundData.Name = string.Empty; + assessmentSection.BackgroundData.IsVisible = false; + assessmentSection.BackgroundData.Parameters.Clear(); if (selectedMapData != null) { selectedMapData.IsVisible = true; - assessmentSection.BackgroundMapData2.IsVisible = selectedMapData.IsVisible; - assessmentSection.BackgroundMapData2.IsConfigured = selectedMapData.IsConfigured; - assessmentSection.BackgroundMapData2.Name = selectedMapData.Name; + assessmentSection.BackgroundData.IsVisible = selectedMapData.IsVisible; + assessmentSection.BackgroundData.IsConfigured = selectedMapData.IsConfigured; + assessmentSection.BackgroundData.Name = selectedMapData.Name; var selectedWmtsMapData = selectedMapData as WmtsMapData; if (selectedWmtsMapData != null) { - assessmentSection.BackgroundMapData2.Parameters["SourceCapabilitiesUrl"] = selectedWmtsMapData.SourceCapabilitiesUrl; - assessmentSection.BackgroundMapData2.Parameters["SelectedCapabilityIdentifier"] = selectedWmtsMapData.SelectedCapabilityIdentifier; - assessmentSection.BackgroundMapData2.Parameters["PreferredFormat"] = selectedWmtsMapData.PreferredFormat; + assessmentSection.BackgroundData.Parameters["SourceCapabilitiesUrl"] = selectedWmtsMapData.SourceCapabilitiesUrl; + assessmentSection.BackgroundData.Parameters["SelectedCapabilityIdentifier"] = selectedWmtsMapData.SelectedCapabilityIdentifier; + assessmentSection.BackgroundData.Parameters["PreferredFormat"] = selectedWmtsMapData.PreferredFormat; } } - assessmentSection.BackgroundMapData2.NotifyObservers(); + assessmentSection.BackgroundData.NotifyObservers(); assessmentSection.NotifyObservers(); } @@ -1118,7 +1117,7 @@ { var childNodes = new List { - nodeData.BackgroundMapData2, + nodeData.BackgroundData, new ReferenceLineContext(nodeData), new FailureMechanismContributionContext(nodeData.FailureMechanismContribution, nodeData), new HydraulicBoundaryDatabaseContext(nodeData), Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundDataPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundDataPropertiesTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundDataPropertiesTest.cs (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -0,0 +1,351 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.ComponentModel; +using Core.Common.Base; +using Core.Common.Base.Data; +using Core.Common.Gui.PropertyBag; +using Core.Common.TestUtil; +using Core.Components.Gis.Data; +using Core.Components.Gis.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class BackgroundDataPropertiesTest + { + private const int requiredNamePropertyIndex = 0; + private const int requiredTransparencyPropertyIndex = 1; + private const int requiredVisibilityPropertyIndex = 2; + + private const int wmtsUrlPropertyIndex = 3; + private const int wmtsSelectedCapabilityPropertyIndex = 4; + private const int wmtsPreferredFormatPropertyIndex = 5; + + [Test] + public void Constructor_ContainerNull_ThrowArgumentNullException() + { + // Call + TestDelegate call = () => new BackgroundDataProperties(null); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("backgroundMapData", paramName); + } + + [Test] + public void Constructor_ValidContainer_ExpectedValues() + { + // Setup + var backgroundMapData = new BackgroundData(); + + // Call + var properties = new BackgroundDataProperties(backgroundMapData); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.AreSame(backgroundMapData, properties.Data); + } + + [Test] + public void GetProperties_ContainerWithoutMapData_ReturnExpectedValues() + { + // Setup + var backgroundMapData = new BackgroundData(); + + // Call + var properties = new BackgroundDataProperties(backgroundMapData); + + // Assert + Assert.AreEqual(backgroundMapData.IsVisible, properties.IsVisible); + Assert.AreEqual(backgroundMapData.Transparency, properties.Transparency); + Assert.AreEqual(string.Empty, properties.Name); + Assert.AreEqual(string.Empty, properties.SourceCapabilitiesUrl); + Assert.AreEqual(string.Empty, properties.SelectedCapabilityIdentifier); + Assert.AreEqual(string.Empty, properties.PreferredFormat); + } + + [Test] + public void GetProperties_ContainerWithConfiguredMapData_ReturnExpectedValues() + { + // Setup + const string name = "A"; + + var mapData = new TestImageBasedMapData(name, true); + + var backGroundMapData = new BackgroundData + { + Name = mapData.Name, + IsVisible = false, + Transparency = (RoundedDouble)0.5, + IsConfigured = mapData.IsConfigured + }; + + // Call + var properties = new BackgroundDataProperties(backGroundMapData); + + // Assert + Assert.AreEqual(backGroundMapData.IsVisible, properties.IsVisible); + Assert.AreEqual(backGroundMapData.Transparency, properties.Transparency); + Assert.AreEqual(name, properties.Name); + Assert.AreEqual(string.Empty, properties.SourceCapabilitiesUrl); + Assert.AreEqual(string.Empty, properties.SelectedCapabilityIdentifier); + Assert.AreEqual(string.Empty, properties.PreferredFormat); + } + + [Test] + public void GetProperties_ContainerWithWmtsMapData_ReturnExpectedValues() + { + // Setup + var mapData = WmtsMapData.CreateDefaultPdokMapData(); + + var backgroundMapData = new BackgroundData + { + IsVisible = false, + Transparency = (RoundedDouble)0.5, + Name = mapData.Name, + IsConfigured = mapData.IsConfigured, + BackgroundMapDataType = BackgroundMapDataType.Wmts, + Parameters = + { + { "SourceCapabilitiesUrl", mapData.SourceCapabilitiesUrl }, + { "SelectedCapabilityIdentifier", mapData.SelectedCapabilityIdentifier }, + { "PreferredFormat", mapData.PreferredFormat } + } + }; + + // Call + var properties = new BackgroundDataProperties(backgroundMapData); + + // Assert + Assert.AreEqual(backgroundMapData.IsVisible, properties.IsVisible); + Assert.AreEqual(backgroundMapData.Transparency, properties.Transparency); + Assert.AreEqual(mapData.Name, properties.Name); + Assert.AreEqual(mapData.SourceCapabilitiesUrl, properties.SourceCapabilitiesUrl); + Assert.AreEqual(mapData.SelectedCapabilityIdentifier, properties.SelectedCapabilityIdentifier); + Assert.AreEqual(mapData.PreferredFormat, properties.PreferredFormat); + } + + [Test] + public void GetProperties_ContainerWithUnconfiguredMapData_ReturnExpectedValues() + { + // Setup + const string name = "A"; + + var mapData = new TestImageBasedMapData(name, false); + + var backgroundMapData = new BackgroundData + { + Name = mapData.Name, + Transparency = mapData.Transparency, + IsVisible = mapData.IsVisible, + IsConfigured = mapData.IsConfigured + }; + + // Call + var properties = new BackgroundDataProperties(backgroundMapData); + + // Assert + Assert.AreEqual(backgroundMapData.IsVisible, properties.IsVisible); + Assert.AreEqual(backgroundMapData.Transparency, properties.Transparency); + Assert.AreEqual(string.Empty, properties.Name); + } + + [Test] + public void SetProperties_IndividualProperties_UpdateDataAndNotifyObservers() + { + // Setup + const int numberOfChangedProperties = 2; + + var mockRepository = new MockRepository(); + var observer = mockRepository.StrictMock(); + observer.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChangedProperties); + mockRepository.ReplayAll(); + + var backgroundMapData = new BackgroundData(); + backgroundMapData.Attach(observer); + + var properties = new BackgroundDataProperties(backgroundMapData); + + var random = new Random(123); + bool newVisibility = random.NextBoolean(); + RoundedDouble newTransparency = random.NextRoundedDouble(); + + // Call + properties.IsVisible = newVisibility; + properties.Transparency = newTransparency; + + // Assert + Assert.AreEqual(newTransparency, properties.Transparency, properties.Transparency.GetAccuracy()); + Assert.AreEqual(newVisibility, properties.IsVisible); + + mockRepository.VerifyAll(); + } + + [Test] + public void Constructor_WithoutMapData_PropertiesHaveExpectedAttributesValues() + { + // Setup + var backgroundMapData = new BackgroundData(); + + // Call + var properties = new BackgroundDataProperties(backgroundMapData); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(3, dynamicProperties.Count); + + PropertyDescriptor nameProperty = dynamicProperties[requiredNamePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + "Algemeen", + "Omschrijving", + "Omschrijving van de achtergrond kaartlaag.", + true); + + PropertyDescriptor transparencyPropertyIndex = dynamicProperties[requiredTransparencyPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(transparencyPropertyIndex, + "Algemeen", + "Transparantie", + "Transparantie waarmee de achtergrond kaartlaag wordt weergegeven."); + + PropertyDescriptor visibilityProperty = dynamicProperties[requiredVisibilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(visibilityProperty, + "Algemeen", + "Weergeven", + "Geeft aan of de geselecteerde achtergrond kaartlaag in alle kaarten van dit traject wordt weergegeven."); + } + + [Test] + public void Constructor_WithUnconfiguredMapData_PropertiesHaveExpectedAttributesValues() + { + // Setup + var testImageBasedMapData = new TestImageBasedMapData("name", false); + var backgroundMapData = new BackgroundData + { + Name = testImageBasedMapData.Name, + IsVisible = testImageBasedMapData.IsVisible, + IsConfigured = testImageBasedMapData.IsConfigured, + Transparency = testImageBasedMapData.Transparency + }; + + // Call + var properties = new BackgroundDataProperties(backgroundMapData); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(3, dynamicProperties.Count); + + PropertyDescriptor nameProperty = dynamicProperties[requiredNamePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + "Algemeen", + "Omschrijving", + "Omschrijving van de achtergrond kaartlaag.", + true); + + PropertyDescriptor transparencyPropertyIndex = dynamicProperties[requiredTransparencyPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(transparencyPropertyIndex, + "Algemeen", + "Transparantie", + "Transparantie waarmee de achtergrond kaartlaag wordt weergegeven."); + + PropertyDescriptor visibilityProperty = dynamicProperties[requiredVisibilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(visibilityProperty, + "Algemeen", + "Weergeven", + "Geeft aan of de geselecteerde achtergrond kaartlaag in alle kaarten van dit traject wordt weergegeven."); + } + + [Test] + public void Constructor_WithWmtsMapData_PropertiesHaveExpectedAttributesValues() + { + // Setup + WmtsMapData defaultPdokMapData = WmtsMapData.CreateDefaultPdokMapData(); + var backgroundMapData = new BackgroundData + { + Name = defaultPdokMapData.Name, + Transparency = defaultPdokMapData.Transparency, + IsVisible = defaultPdokMapData.IsVisible, + IsConfigured = defaultPdokMapData.IsConfigured, + BackgroundMapDataType = BackgroundMapDataType.Wmts, + Parameters = + { + { "SourceCapabilitiesUrl", defaultPdokMapData.SourceCapabilitiesUrl }, + { "SelectedCapabilityIdentifier", defaultPdokMapData.SelectedCapabilityIdentifier }, + { "PreferredFormat", defaultPdokMapData.PreferredFormat } + } + }; + + // Call + var properties = new BackgroundDataProperties(backgroundMapData); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(6, dynamicProperties.Count); + + PropertyDescriptor nameProperty = dynamicProperties[requiredNamePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + "Algemeen", + "Omschrijving", + "Omschrijving van de achtergrond kaartlaag.", + true); + + PropertyDescriptor transparencyPropertyIndex = dynamicProperties[requiredTransparencyPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(transparencyPropertyIndex, + "Algemeen", + "Transparantie", + "Transparantie waarmee de achtergrond kaartlaag wordt weergegeven."); + + PropertyDescriptor visibilityProperty = dynamicProperties[requiredVisibilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(visibilityProperty, + "Algemeen", + "Weergeven", + "Geeft aan of de geselecteerde achtergrond kaartlaag in alle kaarten van dit traject wordt weergegeven."); + + const string wmtsCategory = "WMTS"; + PropertyDescriptor urlProperty = dynamicProperties[wmtsUrlPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(urlProperty, + wmtsCategory, + "URL", + "Volledige URL naar de Web Map Tile Service (WMTS) die als achtergrond kaartlaag gebruikt wordt.", + true); + + PropertyDescriptor selectedCapabilityProperty = dynamicProperties[wmtsSelectedCapabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(selectedCapabilityProperty, + wmtsCategory, + "Kaartlaag", + "De naam van de geselecteerde kaartlaag.", + true); + + PropertyDescriptor preferredFormatProperty = dynamicProperties[wmtsPreferredFormatPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(preferredFormatProperty, + wmtsCategory, + "Formaat", + "Het type afbeelding die door de geselecteerde kaartlaag aangeleverd wordt.", + true); + } + } +} \ No newline at end of file Fisheye: Tag 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundMapDataPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -71,7 +71,7 @@ - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -113,7 +113,7 @@ view.Data = assessmentSection; // Assert - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundMapData2); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -155,7 +155,7 @@ Assert.AreSame(assessmentSection, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -269,19 +269,19 @@ { view.Data = assessmentSection; - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/BackgroundDataPropertyInfoTest .cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/BackgroundDataPropertyInfoTest .cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/BackgroundDataPropertyInfoTest .cs (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -0,0 +1,95 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Collections.Generic; +using System.Linq; +using Core.Common.Gui.Plugin; +using Core.Common.Gui.PropertyBag; +using Core.Components.Gis.Data; +using NUnit.Framework; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Plugin.Test.PropertyInfos +{ + [TestFixture] + public class BackgroundDataPropertyInfoTest + { + private RingtoetsPlugin plugin; + private PropertyInfo info; + + private static readonly WellKnownTileSourceMapData wellKnownMapData = new WellKnownTileSourceMapData(WellKnownTileSource.BingRoads); + private static readonly WmtsMapData wmtsMapData = WmtsMapData.CreateDefaultPdokMapData(); + + private static IEnumerable ValidBackgroundMapDatas + { + get + { + yield return new TestCaseData(new BackgroundData()); + yield return new TestCaseData(new BackgroundData + { + Name = wellKnownMapData.Name, + BackgroundMapDataType = BackgroundMapDataType.WellKnown, + IsConfigured = wellKnownMapData.IsConfigured + }); + yield return new TestCaseData(new BackgroundData + { + Name = wmtsMapData.Name, + BackgroundMapDataType = BackgroundMapDataType.Wmts, + IsConfigured = wmtsMapData.IsConfigured + }); + } + } + + [SetUp] + public void SetUp() + { + plugin = new RingtoetsPlugin(); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(BackgroundDataProperties)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(BackgroundData), info.DataType); + Assert.AreEqual(typeof(BackgroundDataProperties), info.PropertyObjectType); + } + + [Test] + [TestCaseSource(nameof(ValidBackgroundMapDatas))] + public void CreateInstance_ValidBackgroundMapData_ReturnBackgroundMapDataProperties(BackgroundData backgroundData) + { + // Call + IObjectProperties objectProperties = info.CreateInstance(backgroundData); + + // Assert + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(backgroundData, objectProperties.Data); + } + } +} \ No newline at end of file Fisheye: Tag 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/BackgroundMapDataPropertyInfoTest .cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -87,14 +87,14 @@ - + - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -35,7 +35,6 @@ using Core.Common.Gui.Settings; using Core.Common.Gui.TestUtil; using Core.Common.TestUtil; -using Core.Components.Gis; using NUnit.Extensions.Forms; using NUnit.Framework; using Rhino.Mocks; @@ -217,8 +216,8 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, - typeof(BackgroundMapData), - typeof(BackgroundMapDataProperties)); + typeof(BackgroundData), + typeof(BackgroundDataProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, @@ -406,7 +405,7 @@ // Assert Assert.AreEqual(26, treeNodeInfos.Length); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(AssessmentSection))); - Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(BackgroundMapData))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(BackgroundData))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(ReferenceLineContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(FailureMechanismContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(CategoryTreeFolder))); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -182,8 +182,8 @@ // Assert Assert.AreEqual(23, objects.Length); - var backgroundMapData = (BackgroundMapData) objects[0]; - Assert.AreSame(assessmentSection.BackgroundMapData2, backgroundMapData); + var backgroundMapData = (BackgroundData) objects[0]; + Assert.AreSame(assessmentSection.BackgroundData, backgroundMapData); var referenceLineContext = (ReferenceLineContext) objects[1]; Assert.AreSame(assessmentSection, referenceLineContext.WrappedData); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -0,0 +1,497 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Drawing; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Base; +using Core.Common.Controls.TreeView; +using Core.Common.Gui; +using Core.Common.Gui.Commands; +using Core.Common.Gui.ContextMenu; +using Core.Common.Gui.Forms.MainWindow; +using Core.Common.Gui.TestUtil.ContextMenu; +using Core.Common.TestUtil; +using Core.Components.Gis.Data; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Integration.Forms; +using Ringtoets.Integration.Forms.Properties; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Plugin.Test.TreeNodeInfos +{ + [TestFixture] + public class BackgroundDataTreeNodeInfoTest : NUnitFormTest + { + private const int selectContextMenuIndex = 0; + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNotNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNotNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } + } + + [Test] + public void Text_Always_ReturnsName() + { + // Setup + var backgroundMapData = new BackgroundData(); + + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + string text = info.Text(backgroundMapData); + + // Assert + Assert.AreEqual("Achtergrondkaart", text); + } + } + + [Test] + public void Image_Always_ReturnsSetImage() + { + // Setup + var backgroundMapData = new BackgroundData(); + + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Image image = info.Image(backgroundMapData); + + // Assert + TestHelper.AssertImagesAreEqual(Resources.Map, image); + } + } + + [Test] + public void ForeColor_ConnectedMapData_ReturnControlText() + { + WmtsMapData mapData = WmtsMapData.CreateDefaultPdokMapData(); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(mapData); + + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Color image = info.ForeColor(backgroundData); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), image); + } + } + + [Test] + public void ForeColor_UnconnectedMapData_ReturnGrayText() + { + WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(mapData); + + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Color image = info.ForeColor(backgroundData); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), image); + } + } + + [Test] + public void ForeColor_MapDataNull_ReturnGrayText() + { + var backgroundMapData = new BackgroundData(); + + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Color image = info.ForeColor(backgroundMapData); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), image); + } + } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var mockRepository = new MockRepository(); + + var menuBuilderMock = mockRepository.StrictMock(); + using (mockRepository.Ordered()) + { + menuBuilderMock.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + } + + using (var treeViewControl = new TreeViewControl()) + { + var gui = mockRepository.Stub(); + gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + mockRepository.ReplayAll(); + + using (var plugin = new RingtoetsPlugin()) + { + var info = GetInfo(plugin); + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + } + } + // Assert + mockRepository.VerifyAll(); + } + + [Test] + public void ContextMenuStrip_Always_ContextMenuItemSelectMapLayerEnabled() + { + // Setup + var mockRepository = new MockRepository(); + var backgroundMapData = new BackgroundData(); + + var assessmentSection = mockRepository.Stub(); + using (var treeViewControl = new TreeViewControl()) + { + var gui = mockRepository.Stub(); + gui.Stub(g => g.Get(backgroundMapData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + mockRepository.ReplayAll(); + + using (var plugin = new RingtoetsPlugin()) + { + var info = GetInfo(plugin); + plugin.Gui = gui; + + // Call + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(backgroundMapData, assessmentSection, treeViewControl)) + { + const string expectedItemText = "Selecteren..."; + const string expectedItemTooltip = "Selecteer een achtergrondkaart."; + TestHelper.AssertContextMenuStripContainsItem(contextMenu, selectContextMenuIndex, + expectedItemText, expectedItemTooltip, + RingtoetsCommonFormsResources.MapsIcon); + } + } + } + // Assert + mockRepository.VerifyAll(); + } + + [Test] + public void GivenNoMapDataSet_WhenSelectingValidMapDataFromContextMenu_ThenMapDataSetAndNotifiesObserver() + { + // Given + var mockRepository = new MockRepository(); + var assessmentSectionObserver = mockRepository.StrictMock(); + assessmentSectionObserver.Expect(o => o.UpdateObserver()); + + var backgroundMapDataObserver = mockRepository.StrictMock(); + backgroundMapDataObserver.Expect(o => o.UpdateObserver()); + + WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(mapData); + + using (var treeViewControl = new TreeViewControl()) + using (var plugin = new RingtoetsPlugin()) + { + var viewCommands = mockRepository.Stub(); + var mainWindow = mockRepository.Stub(); + + var gui = mockRepository.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + gui.Stub(g => g.ViewCommands).Return(viewCommands); + gui.Stub(cmp => cmp.Get(backgroundData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + mockRepository.ReplayAll(); + + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.Attach(assessmentSectionObserver); + assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + + DialogBoxHandler = (name, wnd) => + { + var tester = (BackgroundMapDataSelectionDialog) new FormTester(name).TheObject; + tester.DialogResult = DialogResult.OK; + tester.Close(); + }; + + TreeNodeInfo info = GetInfo(plugin); + plugin.Gui = gui; + + using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(backgroundData, assessmentSection, treeViewControl)) + { + // When + contextMenuStrip.Items[selectContextMenuIndex].PerformClick(); + + // Then + AssertBackgroundMapDataProperties(mapData, assessmentSection.BackgroundData); + } + } + mockRepository.VerifyAll(); + } + + [Test] + public void GivenNoMapDataSet_WhenSelectingMapDataFromContextMenuCancelled_ThenNoObserversNotified() + { + // Given + var mockRepository = new MockRepository(); + var assessmentSectionObserver = mockRepository.StrictMock(); + var backgroundMapDataObserver = mockRepository.StrictMock(); + + var backgroundMapData = new BackgroundData + { + Name = "background map data" + }; + + using (var treeViewControl = new TreeViewControl()) + using (var plugin = new RingtoetsPlugin()) + { + var viewCommands = mockRepository.Stub(); + var mainWindow = mockRepository.Stub(); + + var gui = mockRepository.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + gui.Stub(g => g.ViewCommands).Return(viewCommands); + gui.Stub(cmp => cmp.Get(backgroundMapData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + mockRepository.ReplayAll(); + + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.Attach(assessmentSectionObserver); + assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + + BackgroundData oldBackgroundData = assessmentSection.BackgroundData; + + DialogBoxHandler = (name, wnd) => + { + var tester = (BackgroundMapDataSelectionDialog) new FormTester(name).TheObject; + tester.DialogResult = DialogResult.Cancel; + tester.Close(); + }; + + TreeNodeInfo info = GetInfo(plugin); + plugin.Gui = gui; + + using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(backgroundMapData, assessmentSection, treeViewControl)) + { + // When + contextMenuStrip.Items[selectContextMenuIndex].PerformClick(); + + // Then + AssertBackgroundMapDataProperties(oldBackgroundData, assessmentSection.BackgroundData); + } + } + mockRepository.VerifyAll(); + } + + [Test] + public void GivenMapDataSet_WhenSelectingValidMapDataFromContextMenu_ThenMapDataSetAndNotifiesObserver() + { + // Given + var mockRepository = new MockRepository(); + var assessmentSectionObserver = mockRepository.StrictMock(); + assessmentSectionObserver.Expect(o => o.UpdateObserver()); + + var backgroundMapDataObserver = mockRepository.StrictMock(); + backgroundMapDataObserver.Expect(o => o.UpdateObserver()); + + WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); + + WmtsMapData newMapData = WmtsMapData.CreateDefaultPdokMapData(); + var newBackgroundMapdata = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(newMapData); + + var assessmentSection = new ObservableTestAssessmentSectionStub(); + + using (var treeViewControl = new TreeViewControl()) + using (var plugin = new RingtoetsPlugin()) + { + var viewCommands = mockRepository.Stub(); + var mainWindow = mockRepository.Stub(); + + var gui = mockRepository.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + gui.Stub(g => g.ViewCommands).Return(viewCommands); + gui.Stub(cmp => cmp.Get(newBackgroundMapdata, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + mockRepository.ReplayAll(); + + assessmentSection.Attach(assessmentSectionObserver); + assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + assessmentSection.BackgroundData.Name = mapData.Name; + assessmentSection.BackgroundData.IsVisible = mapData.IsVisible; + assessmentSection.BackgroundData.IsConfigured = mapData.IsConfigured; + assessmentSection.BackgroundData.Transparency = mapData.Transparency; + assessmentSection.BackgroundData.BackgroundMapDataType = BackgroundMapDataType.Wmts; + assessmentSection.BackgroundData.Parameters["SourceCapabilitiesUrl"] = mapData.SourceCapabilitiesUrl; + assessmentSection.BackgroundData.Parameters["SelectedCapabilityIdentifier"] = mapData.SelectedCapabilityIdentifier; + assessmentSection.BackgroundData.Parameters["PreferredFormat"] = mapData.PreferredFormat; + + DialogBoxHandler = (name, wnd) => + { + var tester = (BackgroundMapDataSelectionDialog) new FormTester(name).TheObject; + tester.DialogResult = DialogResult.OK; + tester.Close(); + }; + + TreeNodeInfo info = GetInfo(plugin); + plugin.Gui = gui; + + using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(newBackgroundMapdata, assessmentSection, treeViewControl)) + { + // When + contextMenuStrip.Items[selectContextMenuIndex].PerformClick(); + + // Then + AssertBackgroundMapDataProperties(newMapData, assessmentSection.BackgroundData); + } + } + mockRepository.VerifyAll(); + } + + [Test] + public void GivenMapDataSet_WhenSelectingMapDataFromContextMenuCancelled_ThenNoObserversNotified() + { + // Given + var mockRepository = new MockRepository(); + var assessmentSectionObserver = mockRepository.StrictMock(); + var backgroundMapDataObserver = mockRepository.StrictMock(); + + WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); + BackgroundData backgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(mapData); + BackgroundData newBackgroundData = BackgroundMapDataTestDataGenerator.GetWmtsBackgroundMapData(WmtsMapData.CreateDefaultPdokMapData()); + + using (var treeViewControl = new TreeViewControl()) + using (var plugin = new RingtoetsPlugin()) + { + var viewCommands = mockRepository.Stub(); + var mainWindow = mockRepository.Stub(); + + var gui = mockRepository.Stub(); + gui.Stub(g => g.MainWindow).Return(mainWindow); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + gui.Stub(g => g.ViewCommands).Return(viewCommands); + gui.Stub(cmp => cmp.Get(newBackgroundData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + mockRepository.ReplayAll(); + + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.Attach(assessmentSectionObserver); + assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + + assessmentSection.BackgroundData.Name = backgroundData.Name; + assessmentSection.BackgroundData.IsVisible = backgroundData.IsVisible; + assessmentSection.BackgroundData.IsConfigured = backgroundData.IsConfigured; + assessmentSection.BackgroundData.Transparency = backgroundData.Transparency; + assessmentSection.BackgroundData.BackgroundMapDataType = backgroundData.BackgroundMapDataType; + + DialogBoxHandler = (name, wnd) => + { + var tester = (BackgroundMapDataSelectionDialog) new FormTester(name).TheObject; + tester.DialogResult = DialogResult.Cancel; + tester.Close(); + }; + + TreeNodeInfo info = GetInfo(plugin); + plugin.Gui = gui; + + using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(newBackgroundData, assessmentSection, treeViewControl)) + { + // When + contextMenuStrip.Items[selectContextMenuIndex].PerformClick(); + + // Then + AssertBackgroundMapDataProperties(backgroundData, assessmentSection.BackgroundData); + } + } + mockRepository.VerifyAll(); + } + + private static void AssertBackgroundMapDataProperties(WmtsMapData mapData, BackgroundData backgroundData) + { + Assert.AreEqual(mapData.Name, backgroundData.Name); + Assert.IsTrue(backgroundData.IsVisible); + Assert.AreEqual(mapData.IsConfigured, backgroundData.IsConfigured); + Assert.AreEqual(mapData.Transparency, backgroundData.Transparency); + Assert.AreEqual(mapData.SourceCapabilitiesUrl, backgroundData.Parameters["SourceCapabilitiesUrl"]); + Assert.AreEqual(mapData.SelectedCapabilityIdentifier, backgroundData.Parameters["SelectedCapabilityIdentifier"]); + Assert.AreEqual(mapData.PreferredFormat, backgroundData.Parameters["PreferredFormat"]); + } + + private static void AssertBackgroundMapDataProperties(BackgroundData expectedBackgroundData, BackgroundData actualBackgroundData) + { + Assert.AreEqual(expectedBackgroundData.Name, actualBackgroundData.Name); + Assert.AreEqual(expectedBackgroundData.IsVisible, actualBackgroundData.IsVisible); + Assert.AreEqual(expectedBackgroundData.IsConfigured, actualBackgroundData.IsConfigured); + Assert.AreEqual(expectedBackgroundData.Transparency, actualBackgroundData.Transparency); + CollectionAssert.AreEquivalent(expectedBackgroundData.Parameters, actualBackgroundData.Parameters); + } + + private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) + { + return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(BackgroundData)); + } + } +} \ No newline at end of file Fisheye: Tag 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/BackgroundMapDataTreeNodeInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -150,11 +150,11 @@ calculationGroupObserver.Observable = data.WrappedData.CalculationsGroup; calculationObserver.Observable = data.WrappedData.CalculationsGroup; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -190,7 +190,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -161,7 +161,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -181,7 +181,7 @@ // Assert WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -479,19 +479,19 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); view.Data = new PipingFailureMechanismContext(new PipingFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs (.../StabilityPointStructuresFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismView.cs (.../StabilityPointStructuresFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -152,11 +152,11 @@ calculationGroupObserver.Observable = data.WrappedData.CalculationsGroup; calculationObserver.Observable = data.WrappedData.CalculationsGroup; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -192,7 +192,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -133,7 +133,7 @@ // Assert - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundMapData2); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -182,7 +182,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -433,19 +433,19 @@ view.Data = new StabilityPointStructuresFailureMechanismContext(new StabilityPointStructuresFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then - WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs (.../StabilityStoneCoverFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverFailureMechanismView.cs (.../StabilityStoneCoverFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -145,11 +145,11 @@ calculationGroupObserver.Observable = data.WrappedData.WaveConditionsCalculationGroup; calculationObserver.Observable = data.WrappedData.WaveConditionsCalculationGroup; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -184,7 +184,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -129,7 +129,7 @@ // Assert WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -178,7 +178,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -291,20 +291,20 @@ view.Data = new StabilityStoneCoverFailureMechanismContext(new StabilityStoneCoverFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - backgroundMapData); + backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismView.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismView.cs (.../WaveImpactAsphaltCoverFailureMechanismView.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismView.cs (.../WaveImpactAsphaltCoverFailureMechanismView.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -145,11 +145,11 @@ calculationGroupObserver.Observable = data.WrappedData.WaveConditionsCalculationGroup; calculationObserver.Observable = data.WrappedData.WaveConditionsCalculationGroup; - backgroundMapDataObserver.Observable = data.Parent.BackgroundMapData2; + backgroundMapDataObserver.Observable = data.Parent.BackgroundData; SetMapDataFeatures(); - backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundMapData2); + backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(data.Parent.BackgroundData); Map.Data = mapDataCollection; Map.BackgroundMapData = backgroundMapData; @@ -184,7 +184,7 @@ private void UpdateBackgroundMapData() { - RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundMapData2); + RingtoetsBackgroundMapDataFactory.UpdateBackgroundMapData(backgroundMapData, data.Parent.BackgroundData); backgroundMapData.NotifyObservers(); } Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs =================================================================== diff -u -rb519fc798c63691f04bb8008b562a94ed9232d51 -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4) @@ -129,7 +129,7 @@ // Assert WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -178,7 +178,7 @@ Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundMapData2); + assessmentSection.BackgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } } @@ -292,20 +292,20 @@ view.Data = new WaveImpactAsphaltCoverFailureMechanismContext(new WaveImpactAsphaltCoverFailureMechanism(), assessmentSection); - BackgroundMapData backgroundMapData = assessmentSection.BackgroundMapData2; + BackgroundData backgroundData = assessmentSection.BackgroundData; - backgroundMapData.Name = "some Name"; - backgroundMapData.Parameters["SourceCapabilitiesUrl"] = "some URL"; - backgroundMapData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; - backgroundMapData.Parameters["PreferredFormat"] = "image/some Format"; - backgroundMapData.IsConfigured = true; + backgroundData.Name = "some Name"; + backgroundData.Parameters["SourceCapabilitiesUrl"] = "some URL"; + backgroundData.Parameters["SelectedCapabilityIdentifier"] = "some Identifier"; + backgroundData.Parameters["PreferredFormat"] = "image/some Format"; + backgroundData.IsConfigured = true; // When - backgroundMapData.NotifyObservers(); + backgroundData.NotifyObservers(); // Then WmtsMapData expectedWmtsBackgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - backgroundMapData); + backgroundData); MapDataTestHelper.AssertWmtsMapData(expectedWmtsBackgroundMapData, view.Map.BackgroundMapData); } }