Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapControl.cs =================================================================== diff -u -r7f540fc512a6c291d69612b1d0b9241d42288aef -ra1a0212c2ed8572ed8414f77172bd698441e58b7 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapControl.cs (.../RingtoetsMapControl.cs) (revision 7f540fc512a6c291d69612b1d0b9241d42288aef) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapControl.cs (.../RingtoetsMapControl.cs) (revision a1a0212c2ed8572ed8414f77172bd698441e58b7) @@ -32,7 +32,7 @@ /// public class RingtoetsMapControl : MapControl { - private readonly Observer backgroundMapDataObserver; + private readonly Observer backgroundDataObserver; private BackgroundData backgroundData; @@ -41,7 +41,7 @@ /// public RingtoetsMapControl() { - backgroundMapDataObserver = new Observer(OnBackgroundDataUpdated); + backgroundDataObserver = new Observer(OnBackgroundDataUpdated); } /// @@ -56,7 +56,7 @@ set { backgroundData = value; - backgroundMapDataObserver.Observable = backgroundData; + backgroundDataObserver.Observable = backgroundData; BackgroundMapData = backgroundData == null ? null @@ -74,7 +74,7 @@ protected override void Dispose(bool disposing) { - backgroundMapDataObserver.Dispose(); + backgroundDataObserver.Dispose(); base.Dispose(disposing); } Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/BackgroundDataTestDataGenerator.cs =================================================================== diff -u -r9f22d388df3a8fb1ca103eb046e0cc8866d588a0 -ra1a0212c2ed8572ed8414f77172bd698441e58b7 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/BackgroundDataTestDataGenerator.cs (.../BackgroundDataTestDataGenerator.cs) (revision 9f22d388df3a8fb1ca103eb046e0cc8866d588a0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/BackgroundDataTestDataGenerator.cs (.../BackgroundDataTestDataGenerator.cs) (revision a1a0212c2ed8572ed8414f77172bd698441e58b7) @@ -37,17 +37,15 @@ /// The created . public static BackgroundData GetWmtsBackgroundMapData(WmtsMapData wmtsMapData) { - var backgroundMapData = new BackgroundData(new WmtsBackgroundDataConfiguration(wmtsMapData.IsConfigured, - wmtsMapData.SourceCapabilitiesUrl, - wmtsMapData.SelectedCapabilityIdentifier, - wmtsMapData.PreferredFormat)) + return new BackgroundData(new WmtsBackgroundDataConfiguration(wmtsMapData.IsConfigured, + wmtsMapData.SourceCapabilitiesUrl, + wmtsMapData.SelectedCapabilityIdentifier, + wmtsMapData.PreferredFormat)) { Name = wmtsMapData.Name, IsVisible = wmtsMapData.IsVisible, Transparency = wmtsMapData.Transparency }; - - return backgroundMapData; } /// Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundDataPropertiesTest.cs =================================================================== diff -u -rf372658df422303abcebd8206c8127b420a3ccc2 -ra1a0212c2ed8572ed8414f77172bd698441e58b7 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundDataPropertiesTest.cs (.../BackgroundDataPropertiesTest.cs) (revision f372658df422303abcebd8206c8127b420a3ccc2) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/BackgroundDataPropertiesTest.cs (.../BackgroundDataPropertiesTest.cs) (revision a1a0212c2ed8572ed8414f77172bd698441e58b7) @@ -61,32 +61,32 @@ public void Constructor_ValidBackgroundData_ExpectedValues() { // Setup - var backgroundMapData = new BackgroundData(new TestBackgroundDataConfiguration()); + var backgroundData = new BackgroundData(new TestBackgroundDataConfiguration()); // Call - var properties = new BackgroundDataProperties(backgroundMapData); + var properties = new BackgroundDataProperties(backgroundData); // Assert Assert.IsInstanceOf>(properties); - Assert.AreSame(backgroundMapData, properties.Data); + Assert.AreSame(backgroundData, properties.Data); } [Test] public void GetProperties_BackgroundDataWithUnconfiguredWmtsConfiguration_ReturnExpectedValues() { // Setup - var backGroundMapData = new BackgroundData(new WmtsBackgroundDataConfiguration()) + var backgroundData = new BackgroundData(new WmtsBackgroundDataConfiguration()) { IsVisible = false, Transparency = (RoundedDouble) 0.5 }; // Call - var properties = new BackgroundDataProperties(backGroundMapData); + var properties = new BackgroundDataProperties(backgroundData); // Assert - Assert.AreEqual(backGroundMapData.IsVisible, properties.IsVisible); - Assert.AreEqual(backGroundMapData.Transparency, properties.Transparency); + Assert.AreEqual(backgroundData.IsVisible, properties.IsVisible); + Assert.AreEqual(backgroundData.Transparency, properties.Transparency); Assert.AreEqual(string.Empty, properties.Name); Assert.AreEqual(string.Empty, properties.SourceCapabilitiesUrl); Assert.AreEqual(string.Empty, properties.SelectedCapabilityIdentifier); @@ -99,22 +99,22 @@ // Setup var mapData = WmtsMapData.CreateDefaultPdokMapData(); - var backgroundMapData = new BackgroundData(new WmtsBackgroundDataConfiguration(mapData.IsConfigured, - mapData.SourceCapabilitiesUrl, - mapData.SelectedCapabilityIdentifier, - mapData.PreferredFormat)) + var backgroundData = new BackgroundData(new WmtsBackgroundDataConfiguration(mapData.IsConfigured, + mapData.SourceCapabilitiesUrl, + mapData.SelectedCapabilityIdentifier, + mapData.PreferredFormat)) { IsVisible = false, Transparency = (RoundedDouble) 0.5, Name = mapData.Name }; // Call - var properties = new BackgroundDataProperties(backgroundMapData); + var properties = new BackgroundDataProperties(backgroundData); // Assert - Assert.AreEqual(backgroundMapData.IsVisible, properties.IsVisible); - Assert.AreEqual(backgroundMapData.Transparency, properties.Transparency); + Assert.AreEqual(backgroundData.IsVisible, properties.IsVisible); + Assert.AreEqual(backgroundData.Transparency, properties.Transparency); Assert.AreEqual(mapData.Name, properties.Name); Assert.AreEqual(mapData.SourceCapabilitiesUrl, properties.SourceCapabilitiesUrl); Assert.AreEqual(mapData.SelectedCapabilityIdentifier, properties.SelectedCapabilityIdentifier); @@ -128,19 +128,19 @@ const string name = "A"; var mapData = new TestImageBasedMapData(name, false); - var backgroundMapData = new BackgroundData(new WellKnownBackgroundDataConfiguration(RingtoetsWellKnownTileSource.BingAerial)) + var backgroundData = new BackgroundData(new WellKnownBackgroundDataConfiguration(RingtoetsWellKnownTileSource.BingAerial)) { Name = mapData.Name, Transparency = mapData.Transparency, IsVisible = mapData.IsVisible }; // Call - var properties = new BackgroundDataProperties(backgroundMapData); + var properties = new BackgroundDataProperties(backgroundData); // Assert - Assert.AreEqual(backgroundMapData.IsVisible, properties.IsVisible); - Assert.AreEqual(backgroundMapData.Transparency, properties.Transparency); + Assert.AreEqual(backgroundData.IsVisible, properties.IsVisible); + Assert.AreEqual(backgroundData.Transparency, properties.Transparency); Assert.AreEqual(mapData.Name, properties.Name); } @@ -155,10 +155,10 @@ observer.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChangedProperties); mockRepository.ReplayAll(); - var backgroundMapData = new BackgroundData(new TestBackgroundDataConfiguration()); - backgroundMapData.Attach(observer); + var backgroundData = new BackgroundData(new TestBackgroundDataConfiguration()); + backgroundData.Attach(observer); - var properties = new BackgroundDataProperties(backgroundMapData); + var properties = new BackgroundDataProperties(backgroundData); var random = new Random(123); bool newVisibility = random.NextBoolean(); @@ -179,10 +179,10 @@ public void Constructor_WithNonWmtsMapDataConfiguration_PropertiesHaveExpectedAttributesValues() { // Setup - var backgroundMapData = new BackgroundData(new TestBackgroundDataConfiguration()); + var backgroundData = new BackgroundData(new TestBackgroundDataConfiguration()); // Call - var properties = new BackgroundDataProperties(backgroundMapData); + var properties = new BackgroundDataProperties(backgroundData); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -213,15 +213,15 @@ { // Setup var testImageBasedMapData = new TestImageBasedMapData("name", false); - var backgroundMapData = new BackgroundData(new WmtsBackgroundDataConfiguration(testImageBasedMapData.IsConfigured, null, null, null)) + var backgroundData = new BackgroundData(new WmtsBackgroundDataConfiguration(testImageBasedMapData.IsConfigured, null, null, null)) { Name = testImageBasedMapData.Name, IsVisible = testImageBasedMapData.IsVisible, Transparency = testImageBasedMapData.Transparency }; // Call - var properties = new BackgroundDataProperties(backgroundMapData); + var properties = new BackgroundDataProperties(backgroundData); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -252,18 +252,18 @@ { // Setup WmtsMapData defaultPdokMapData = WmtsMapData.CreateDefaultPdokMapData(); - var backgroundMapData = new BackgroundData(new WmtsBackgroundDataConfiguration(defaultPdokMapData.IsConfigured, - defaultPdokMapData.SourceCapabilitiesUrl, - defaultPdokMapData.SelectedCapabilityIdentifier, - defaultPdokMapData.PreferredFormat)) + var backgroundData = new BackgroundData(new WmtsBackgroundDataConfiguration(defaultPdokMapData.IsConfigured, + defaultPdokMapData.SourceCapabilitiesUrl, + defaultPdokMapData.SelectedCapabilityIdentifier, + defaultPdokMapData.PreferredFormat)) { Name = defaultPdokMapData.Name, Transparency = defaultPdokMapData.Transparency, IsVisible = defaultPdokMapData.IsVisible }; // Call - var properties = new BackgroundDataProperties(backgroundMapData); + var properties = new BackgroundDataProperties(backgroundData); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs =================================================================== diff -u -r5c1a60942a2effc207d546054d4832f4aabe8ba5 -ra1a0212c2ed8572ed8414f77172bd698441e58b7 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs (.../BackgroundDataTreeNodeInfoTest.cs) (revision 5c1a60942a2effc207d546054d4832f4aabe8ba5) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/BackgroundDataTreeNodeInfoTest.cs (.../BackgroundDataTreeNodeInfoTest.cs) (revision a1a0212c2ed8572ed8414f77172bd698441e58b7) @@ -87,14 +87,14 @@ public void Text_Always_ReturnsName() { // Setup - var backgroundMapData = new BackgroundData(new TestBackgroundDataConfiguration()); + var backgroundData = new BackgroundData(new TestBackgroundDataConfiguration()); using (var plugin = new RingtoetsPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call - string text = info.Text(backgroundMapData); + string text = info.Text(backgroundData); // Assert Assert.AreEqual("Achtergrondkaart", text); @@ -105,14 +105,14 @@ public void Image_Always_ReturnsSetImage() { // Setup - var backgroundMapData = new BackgroundData(new TestBackgroundDataConfiguration()); + var backgroundData = new BackgroundData(new TestBackgroundDataConfiguration()); using (var plugin = new RingtoetsPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call - Image image = info.Image(backgroundMapData); + Image image = info.Image(backgroundData); // Assert TestHelper.AssertImagesAreEqual(Resources.Map, image); @@ -181,14 +181,14 @@ public void ForeColor_ArbitraryBackgroundDataConfiguration_ReturnControlText() { // Setup - var backgroundMapData = new BackgroundData(new TestBackgroundDataConfiguration()); + var backgroundData = new BackgroundData(new TestBackgroundDataConfiguration()); using (var plugin = new RingtoetsPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call - Color image = info.ForeColor(backgroundMapData); + Color image = info.ForeColor(backgroundData); // Assert Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), image); @@ -219,7 +219,7 @@ using (var plugin = new RingtoetsPlugin()) { - var info = GetInfo(plugin); + TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; // Call @@ -234,25 +234,25 @@ public void ContextMenuStrip_Always_ContextMenuItemSelectMapLayerEnabled() { // Setup - var backgroundMapData = new BackgroundData(new TestBackgroundDataConfiguration()); + var backgroundData = new BackgroundData(new TestBackgroundDataConfiguration()); var mockRepository = new MockRepository(); 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.Get(backgroundData, 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); + TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(backgroundMapData, assessmentSection, treeViewControl)) + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(backgroundData, assessmentSection, treeViewControl)) { const string expectedItemText = "&Selecteren..."; const string expectedItemTooltip = "Selecteer een achtergrondkaart."; @@ -272,18 +272,18 @@ // Given var mockRepository = new MockRepository(); var tileFactory = mockRepository.StrictMock(); - WmtsMapData newMapData = new WmtsMapData("Actueel Hoogtebestand Nederland (AHN1)", - "https://geodata.nationaalgeoregister.nl/tiles/service/wmts/ahn1?request=GetCapabilities", - "()", "image/png"); + var newMapData = new WmtsMapData("Actueel Hoogtebestand Nederland (AHN1)", + "https://geodata.nationaalgeoregister.nl/tiles/service/wmts/ahn1?request=GetCapabilities", + "()", "image/png"); tileFactory.Expect(tf => tf.GetWmtsTileSources(null)).IgnoreArguments().Return(new[] { new TestWmtsTileSource(newMapData) }); var assessmentSectionObserver = mockRepository.StrictMock(); assessmentSectionObserver.Expect(o => o.UpdateObserver()); - var backgroundMapDataObserver = mockRepository.StrictMock(); - backgroundMapDataObserver.Expect(o => o.UpdateObserver()); + var backgroundDataObserver = mockRepository.StrictMock(); + backgroundDataObserver.Expect(o => o.UpdateObserver()); WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); BackgroundData backgroundData = BackgroundDataTestDataGenerator.GetWmtsBackgroundMapData(mapData); @@ -309,7 +309,7 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); assessmentSection.Attach(assessmentSectionObserver); - assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + assessmentSection.BackgroundData.Attach(backgroundDataObserver); DialogBoxHandler = (name, wnd) => { @@ -340,9 +340,9 @@ // Given var mockRepository = new MockRepository(); var assessmentSectionObserver = mockRepository.StrictMock(); - var backgroundMapDataObserver = mockRepository.StrictMock(); + var backgroundDataObserver = mockRepository.StrictMock(); - var backgroundMapData = BackgroundDataTestDataGenerator.GetWellKnownBackgroundMapData(RingtoetsWellKnownTileSource.BingHybrid); + BackgroundData backgroundMapData = BackgroundDataTestDataGenerator.GetWellKnownBackgroundMapData(RingtoetsWellKnownTileSource.BingHybrid); using (new UseCustomSettingsHelper(new TestSettingsHelper { @@ -364,7 +364,7 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); assessmentSection.Attach(assessmentSectionObserver); - assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + assessmentSection.BackgroundData.Attach(backgroundDataObserver); BackgroundData oldBackgroundData = assessmentSection.BackgroundData; @@ -398,13 +398,13 @@ var assessmentSectionObserver = mockRepository.StrictMock(); assessmentSectionObserver.Expect(o => o.UpdateObserver()); - var backgroundMapDataObserver = mockRepository.StrictMock(); - backgroundMapDataObserver.Expect(o => o.UpdateObserver()); + var backgroundDataObserver = mockRepository.StrictMock(); + backgroundDataObserver.Expect(o => o.UpdateObserver()); WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); WmtsMapData newMapData = WmtsMapData.CreateDefaultPdokMapData(); - var newBackgroundMapdata = BackgroundDataTestDataGenerator.GetWmtsBackgroundMapData(newMapData); + BackgroundData newBackgroundMapdata = BackgroundDataTestDataGenerator.GetWmtsBackgroundMapData(newMapData); var assessmentSection = new ObservableTestAssessmentSectionStub(); @@ -428,7 +428,7 @@ mockRepository.ReplayAll(); assessmentSection.Attach(assessmentSectionObserver); - assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + assessmentSection.BackgroundData.Attach(backgroundDataObserver); SetBackgroundData(assessmentSection, mapData); DialogBoxHandler = (name, wnd) => @@ -462,16 +462,16 @@ var assessmentSectionObserver = mockRepository.StrictMock(); assessmentSectionObserver.Expect(o => o.UpdateObserver()); - var backgroundMapDataObserver = mockRepository.StrictMock(); - backgroundMapDataObserver.Expect(o => o.UpdateObserver()); + var backgroundDataObserver = mockRepository.StrictMock(); + backgroundDataObserver.Expect(o => o.UpdateObserver()); WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); var assessmentSection = new ObservableTestAssessmentSectionStub(); const WellKnownTileSource wellKnownTileSource = WellKnownTileSource.BingAerial; var newMapData = new WellKnownTileSourceMapData(wellKnownTileSource); - var newBackgroundData = BackgroundDataTestDataGenerator.GetWellKnownBackgroundMapData((RingtoetsWellKnownTileSource) wellKnownTileSource); + BackgroundData newBackgroundData = BackgroundDataTestDataGenerator.GetWellKnownBackgroundMapData((RingtoetsWellKnownTileSource) wellKnownTileSource); using (new UseCustomSettingsHelper(new TestSettingsHelper { @@ -492,7 +492,7 @@ mockRepository.ReplayAll(); assessmentSection.Attach(assessmentSectionObserver); - assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + assessmentSection.BackgroundData.Attach(backgroundDataObserver); SetBackgroundData(assessmentSection, mapData); DialogBoxHandler = (name, wnd) => @@ -530,7 +530,7 @@ // Given var mockRepository = new MockRepository(); var assessmentSectionObserver = mockRepository.StrictMock(); - var backgroundMapDataObserver = mockRepository.StrictMock(); + var backgroundDataObserver = mockRepository.StrictMock(); WmtsMapData mapData = WmtsMapData.CreateUnconnectedMapData(); BackgroundData backgroundData = BackgroundDataTestDataGenerator.GetWmtsBackgroundMapData(mapData); @@ -559,7 +559,7 @@ var assessmentSection = new ObservableTestAssessmentSectionStub(); assessmentSection.Attach(assessmentSectionObserver); - assessmentSection.BackgroundData.Attach(backgroundMapDataObserver); + assessmentSection.BackgroundData.Attach(backgroundDataObserver); SetBackgroundData(assessmentSection, mapData); @@ -605,7 +605,6 @@ var configuration = (WmtsBackgroundDataConfiguration) backgroundData.Configuration; Assert.AreEqual(mapData.IsConfigured, configuration.IsConfigured); - Assert.AreEqual(mapData.SourceCapabilitiesUrl, configuration.SourceCapabilitiesUrl); Assert.AreEqual(mapData.SelectedCapabilityIdentifier, configuration.SelectedCapabilityIdentifier); Assert.AreEqual(mapData.PreferredFormat, configuration.PreferredFormat); Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -ra1a0212c2ed8572ed8414f77172bd698441e58b7 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision a1a0212c2ed8572ed8414f77172bd698441e58b7) @@ -121,7 +121,7 @@ using (var view = new WaveImpactAsphaltCoverFailureMechanismView()) { - var mapControl = (RingtoetsMapControl)view.Map; + var mapControl = (RingtoetsMapControl) view.Map; var failureMechanismContext = new WaveImpactAsphaltCoverFailureMechanismContext( new WaveImpactAsphaltCoverFailureMechanism(), assessmentSection); @@ -140,7 +140,7 @@ // Setup using (var view = new WaveImpactAsphaltCoverFailureMechanismView()) { - var mapControl = (RingtoetsMapControl)view.Map; + var mapControl = (RingtoetsMapControl) view.Map; var assessmentSection = new ObservableTestAssessmentSectionStub(); @@ -284,7 +284,7 @@ mapDataList[calculationsIndex]); } } - + [Test] public void UpdateObserver_AssessmentSectionUpdated_MapDataUpdated() {