Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundDataEntityReadExtensions.cs =================================================================== diff -u -rfde2f5bd7dfb9f60e298ecf2afe9623dd540e16c -rf2582640849a5a4afce5674db823c37e1edaea19 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundDataEntityReadExtensions.cs (.../BackgroundDataEntityReadExtensions.cs) (revision fde2f5bd7dfb9f60e298ecf2afe9623dd540e16c) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundDataEntityReadExtensions.cs (.../BackgroundDataEntityReadExtensions.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -65,7 +65,7 @@ { IsVisible = Convert.ToBoolean(entity.IsVisible), Transparency = (RoundedDouble) entity.Transparency, - Name = entity.Name, + Name = entity.Name }; return backgroundData; Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs (.../ClosingStructuresFailureMechanismViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismViewTest.cs (.../ClosingStructuresFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -187,9 +187,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -280,7 +278,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -330,7 +328,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase1.Locations, hydraulicBoundaryLocationsMapData); @@ -369,7 +367,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -413,7 +411,7 @@ view.Data = new ClosingStructuresFailureMechanismContext(new ClosingStructuresFailureMechanism(), assessmentSection); - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(currentHydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -459,7 +457,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -524,7 +522,7 @@ view.Data = failureMechanismContext; - var foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); + MapData foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); // Precondition MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, foreshoreProfileData); @@ -557,7 +555,7 @@ view.Data = failureMechanismContext; - var structuresData = map.Data.Collection.ElementAt(structuresIndex); + MapData structuresData = map.Data.Collection.ElementAt(structuresIndex); // Precondition AssertStructures(failureMechanism.ClosingStructures, structuresData); @@ -722,7 +720,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -760,7 +758,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -837,7 +835,7 @@ Assert.AreEqual(structuresArray.Length, structuresData.Features.Length); - for (int i = 0; i < structuresArray.Length; i++) + for (var i = 0; i < structuresArray.Length; i++) { MapGeometry profileDataA = structuresData.Features[i].MapGeometries.First(); Assert.AreEqual(structuresArray[0].Location, profileDataA.PointCollections.First().First()); @@ -854,7 +852,7 @@ var calculationsFeatures = calculationsMapData.Features.ToArray(); Assert.AreEqual(calculationsArray.Length, calculationsFeatures.Length); - for (int index = 0; index < calculationsArray.Length; index++) + for (var index = 0; index < calculationsArray.Length; index++) { var geometries = calculationsFeatures[index].MapGeometries.ToArray(); Assert.AreEqual(1, geometries.Length); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs (.../FailureMechanismViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismViewTest.cs (.../FailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -170,9 +170,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -226,7 +224,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -271,7 +269,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase1.Locations, hydraulicBoundaryLocationsMapData); @@ -310,7 +308,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -354,7 +352,7 @@ view.Data = new FailureMechanismContext(new TestFailureMechanism(), assessmentSection); - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(currentHydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -400,7 +398,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -466,7 +464,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -495,7 +493,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsBackgroundMapDataFactoryTest.cs =================================================================== diff -u -r7071a71d08d7bd205f608b10100665481b94c27a -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsBackgroundMapDataFactoryTest.cs (.../RingtoetsBackgroundMapDataFactoryTest.cs) (revision 7071a71d08d7bd205f608b10100665481b94c27a) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsBackgroundMapDataFactoryTest.cs (.../RingtoetsBackgroundMapDataFactoryTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -59,7 +59,7 @@ [Test] [TestCaseSource(nameof(WmtsMapDatas))] - public void ConvertFrom_WmtsConfiguredBackgroundData_ReturnWmtsMapData(WmtsMapData mapData) + public void CreateBackgroundMapData_WmtsConfiguredBackgroundData_ReturnWmtsMapData(WmtsMapData mapData) { // Setup BackgroundData backgroundData = BackgroundDataTestDataGenerator.GetWmtsBackgroundMapData(mapData); @@ -68,23 +68,22 @@ ImageBasedMapData backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); // Assert - MapDataTestHelper.AssertImageBasedMapData(mapData, backgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(backgroundData, backgroundMapData); } [Test] public void CreateBackgroundMapData_WellKnownConfiguredBackgroundData_ReturnWellKnownMapData() { // Setup var random = new Random(21); - RingtoetsWellKnownTileSource wellKnownTileSource = random.NextEnumValue(); + var wellKnownTileSource = random.NextEnumValue(); BackgroundData backgroundData = BackgroundDataTestDataGenerator.GetWellKnownBackgroundMapData(wellKnownTileSource); // Call ImageBasedMapData backgroundMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundData); // Assert - var expectedMapData = new WellKnownTileSourceMapData((WellKnownTileSource) wellKnownTileSource); - MapDataTestHelper.AssertImageBasedMapData(expectedMapData, backgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(backgroundData, backgroundMapData); } [Test] Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsMapControlTest.cs =================================================================== diff -u -r0f778d2d9cc904175274baf4d6a21996ccef8d54 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsMapControlTest.cs (.../RingtoetsMapControlTest.cs) (revision 0f778d2d9cc904175274baf4d6a21996ccef8d54) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/RingtoetsMapControlTest.cs (.../RingtoetsMapControlTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -122,7 +122,7 @@ public void BackgroundData_NotNull_BackgroundMapDataSet() { // Setup - var mapData = WmtsMapData.CreateDefaultPdokMapData(); + WmtsMapData mapData = WmtsMapData.CreateDefaultPdokMapData(); BackgroundData backgroundData = BackgroundDataTestDataGenerator.GetWmtsBackgroundMapData(mapData); var control = new RingtoetsMapControl(); @@ -136,7 +136,7 @@ // Assert Assert.AreSame(backgroundData, control.BackgroundData); Assert.IsNotNull(control.BackgroundMapData); - MapDataTestHelper.AssertImageBasedMapData(mapData, control.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(backgroundData, control.BackgroundMapData); } } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapDataTestHelperTest.cs =================================================================== diff -u -rfde2f5bd7dfb9f60e298ecf2afe9623dd540e16c -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapDataTestHelperTest.cs (.../MapDataTestHelperTest.cs) (revision fde2f5bd7dfb9f60e298ecf2afe9623dd540e16c) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapDataTestHelperTest.cs (.../MapDataTestHelperTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -32,6 +32,7 @@ using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Utils.TypeConverters; namespace Ringtoets.Common.Forms.TestUtil.Test { @@ -1106,41 +1107,26 @@ #region AssertImageBasedMapData [Test] - public void AssertImageBasedMapData_MapDataNotImageBasedMapData_ThrowAssertionException() - { - // Setup - var mapData = new MapPointData("MapPointData"); - - // Call - TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(WmtsMapData.CreateUnconnectedMapData(), - mapData); - - // Assert - Assert.Throws(test); - } - - [Test] public void AssertImageBasedMapData_ImageBasedMapDataNotSupported_ThrowAssertionException() { // Setup - var mapData = new MapPointData("MapPointData"); var imageBasedMapData = new SimpleImageBasedMapData(); // Call - TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(imageBasedMapData, mapData); + TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(new BackgroundData(new TestBackgroundDataConfiguration()), imageBasedMapData); // Assert Assert.Throws(test); } [Test] - public void AssertImageBasedMapData_ImageBasedMapDataNull_ThrowAssertionException() + public void AssertImageBasedMapData_BackgroundDataNull_ThrowAssertionException() { // Setup - var mapData = new MapPointData("MapPointData"); + var imageBasedMapData = new SimpleImageBasedMapData(); // Call - TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(null, mapData); + TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(null, imageBasedMapData); // Assert Assert.Throws(test); @@ -1150,7 +1136,7 @@ public void AssertImageBasedMapData_DataNull_ThrowAssertionException() { // Call - TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(WmtsMapData.CreateUnconnectedMapData(), + TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(BackgroundDataConverter.ConvertTo(WmtsMapData.CreateUnconnectedMapData()), null); // Assert @@ -1165,7 +1151,7 @@ WmtsMapData mapData = WmtsMapData.CreateDefaultPdokMapData(); // Call - TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(wmtsMapData, mapData); + TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(BackgroundDataConverter.ConvertTo(wmtsMapData), mapData); // Assert Assert.Throws(test); @@ -1179,7 +1165,7 @@ var mapData = new WellKnownTileSourceMapData(WellKnownTileSource.BingAerial); // Call - TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(wellKnownTileSourceMapData, mapData); + TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(BackgroundDataConverter.ConvertTo(wellKnownTileSourceMapData), mapData); // Assert Assert.Throws(test); @@ -1193,7 +1179,7 @@ var actualMapData = new WellKnownTileSourceMapData(WellKnownTileSource.BingAerial); // Call - TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(expectedMapData, actualMapData); + TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(BackgroundDataConverter.ConvertTo(expectedMapData), actualMapData); // Assert Assert.DoesNotThrow(test); @@ -1207,7 +1193,7 @@ WmtsMapData actualMapData = WmtsMapData.CreateUnconnectedMapData(); // Call - TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(expectedMapData, actualMapData); + TestDelegate test = () => MapDataTestHelper.AssertImageBasedMapData(BackgroundDataConverter.ConvertTo(expectedMapData), actualMapData); // Assert Assert.DoesNotThrow(test); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/Ringtoets.Common.Forms.TestUtil.Test.csproj =================================================================== diff -u -r69e449c598057dc5d4703b95ab5c151a76a9cdbf -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/Ringtoets.Common.Forms.TestUtil.Test.csproj (.../Ringtoets.Common.Forms.TestUtil.Test.csproj) (revision 69e449c598057dc5d4703b95ab5c151a76a9cdbf) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/Ringtoets.Common.Forms.TestUtil.Test.csproj (.../Ringtoets.Common.Forms.TestUtil.Test.csproj) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -87,6 +87,10 @@ {4d840673-3812-4338-a352-84854e32b8a0} Ringtoets.Common.Forms + + {6A074D65-A81C-4C1C-8E24-F36C916E4ED7} + Ringtoets.Common.Utils + {4843D6E5-066F-4795-94F5-1D53932DD03C} Ringtoets.Common.Data.TestUtil Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapDataTestHelper.cs =================================================================== diff -u -rd2d96421974b56eb204dd8f756748aa582da0874 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapDataTestHelper.cs (.../MapDataTestHelper.cs) (revision d2d96421974b56eb204dd8f756748aa582da0874) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapDataTestHelper.cs (.../MapDataTestHelper.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -42,26 +42,27 @@ /// /// Asserts whether the contains the data that is representative for the . /// - /// The sections that contains the original data. + /// The sections that contain the original data. /// The that needs to be asserted. /// Thrown when: /// /// is not . /// The name of the is not "Vakindeling". /// The number of sections and features in are not the same. /// The points of a section and the geometry of a corresponding feature are not the same. - /// + /// + /// public static void AssertFailureMechanismSectionsMapData(IEnumerable sections, MapData mapData) { Assert.IsInstanceOf(mapData); Assert.AreEqual("Vakindeling", mapData.Name); - MapLineData sectionsMapLinesData = (MapLineData) mapData; + var sectionsMapLinesData = (MapLineData) mapData; MapFeature[] sectionMapLinesFeatures = sectionsMapLinesData.Features.ToArray(); FailureMechanismSection[] sectionsArray = sections.ToArray(); Assert.AreEqual(sectionsArray.Length, sectionMapLinesFeatures.Length); - for (int index = 0; index < sectionsArray.Length; index++) + for (var index = 0; index < sectionsArray.Length; index++) { MapGeometry geometry = sectionMapLinesFeatures[index].MapGeometries.First(); FailureMechanismSection failureMechanismSection = sectionsArray[index]; @@ -81,13 +82,14 @@ /// has features when is null. /// The number of hydraulic boundary locations and features in are not the same. /// The point of a hydraulic boundary location and the geometry of a corresponding feature are not the same. - /// + /// + /// public static void AssertHydraulicBoundaryLocationsMapData(IEnumerable hydraulicBoundaryLocations, MapData mapData) { Assert.IsInstanceOf(mapData); Assert.AreEqual("Hydraulische randvoorwaarden", mapData.Name); - MapPointData hydraulicLocationsMapData = (MapPointData) mapData; + var hydraulicLocationsMapData = (MapPointData) mapData; if (hydraulicBoundaryLocations == null) { CollectionAssert.IsEmpty(hydraulicLocationsMapData.Features); @@ -105,7 +107,7 @@ /// /// Asserts whether the contains the data that is representative for the . /// - /// The reference line that contain the original data. + /// The reference line that contains the original data. /// The that needs to be asserted. /// Thrown when: /// @@ -114,7 +116,8 @@ /// has features when is null. /// has more than one feature. /// The points of the reference line and the geometry of the first feature are not the same. - /// + /// + /// public static void AssertReferenceLineMapData(ReferenceLine referenceLine, MapData mapData) { Assert.IsInstanceOf(mapData); @@ -135,15 +138,16 @@ /// /// Asserts whether the contains the data that is representative for the start points of the . /// - /// The sections that contains the original data. + /// The sections that contain the original data. /// The that needs to be asserted. /// Thrown when: /// /// is not . /// The name of the is not "Vakindeling (startpunten)". /// has more than one feature. /// The start points of the sections and the geometry of the first feature are not the same. - /// + /// + /// public static void AssertFailureMechanismSectionsStartPointMapData(IEnumerable sections, MapData mapData) { Assert.IsInstanceOf(mapData); @@ -157,15 +161,16 @@ /// /// Asserts whether the contains the data that is representative for the end points of the . /// - /// The sections that contains the original data. + /// The sections that contain the original data. /// The that needs to be asserted. /// Thrown when: /// /// is not . /// The name of the is not "Vakindeling (eindpunten)". /// has more than one feature. /// The end points of the sections and the geometry of the first feature are not the same. - /// + /// + /// public static void AssertFailureMechanismSectionsEndPointMapData(IEnumerable sections, MapData mapData) { Assert.IsInstanceOf(mapData); @@ -179,26 +184,27 @@ /// /// Asserts whether the contains the data that is representative for the . /// - /// The foreshore profiles that contains the original data. + /// The foreshore profiles that contain the original data. /// The that needs to be asserted. /// Thrown when: /// /// is not . /// The name of the is not Voorlandprofielen. /// The amount of features in is not equal to the length of the . /// The geometries of the features in are not equal to the expected geometry of the . - /// + /// + /// public static void AssertForeshoreProfilesMapData(IEnumerable foreshoreProfiles, MapData mapData) { Assert.IsInstanceOf(mapData); Assert.AreEqual("Voorlandprofielen", mapData.Name); - MapLineData foreshoreProfilesData = (MapLineData) mapData; + var foreshoreProfilesData = (MapLineData) mapData; ForeshoreProfile[] foreshoreProfileArray = foreshoreProfiles.ToArray(); Assert.AreEqual(foreshoreProfileArray.Length, foreshoreProfilesData.Features.Length); - for (int i = 0; i < foreshoreProfileArray.Length; i++) + for (var i = 0; i < foreshoreProfileArray.Length; i++) { Point2D[] expectedGeometry = GetWorldPoints(foreshoreProfileArray[i]); MapGeometry profileDataA = foreshoreProfilesData.Features[i].MapGeometries.First(); @@ -207,70 +213,51 @@ } /// - /// Asserts whether the is equivalent to + /// Asserts whether the contains the data that is representative for the . /// - /// The original WMTS map data. - /// The that needs to be asserted. + /// The that contains the original data. + /// The that needs to be asserted. /// Thrown when: /// - /// is not - /// One of the properties of is not equal to - /// - private static void AssertWmtsMapData(WmtsMapData wmtsMapData, MapData mapData) + /// is not of the expected type. + /// One of the properties of is not equal to . + /// + /// + public static void AssertImageBasedMapData(BackgroundData backgroundData, ImageBasedMapData imageBasedMapData) { - Assert.IsInstanceOf(mapData); - Assert.IsNotNull(wmtsMapData); - Assert.AreEqual(wmtsMapData.Name, mapData.Name); - Assert.AreEqual(wmtsMapData.IsVisible, mapData.IsVisible); + Assert.IsNotNull(backgroundData); + Assert.IsNotNull(imageBasedMapData); + Assert.AreEqual(backgroundData.Name, imageBasedMapData.Name); + Assert.AreEqual(backgroundData.IsVisible, imageBasedMapData.IsVisible); + Assert.AreEqual(backgroundData.Transparency, imageBasedMapData.Transparency); - var actualMapData = (WmtsMapData) mapData; - Assert.AreEqual(wmtsMapData.PreferredFormat, actualMapData.PreferredFormat); - Assert.AreEqual(wmtsMapData.SelectedCapabilityIdentifier, actualMapData.SelectedCapabilityIdentifier); - Assert.AreEqual(wmtsMapData.SourceCapabilitiesUrl, actualMapData.SourceCapabilitiesUrl); - Assert.AreEqual(wmtsMapData.IsConfigured, actualMapData.IsConfigured); - Assert.AreEqual(wmtsMapData.Transparency, actualMapData.Transparency); - } - - /// - /// Asserts whether the is equivalent to - /// - /// The original image based map data. - /// The that needs to be asserted. - /// Thrown when: - /// - /// is no ; - /// One of the properties of is not equal to . - /// - public static void AssertImageBasedMapData(ImageBasedMapData imageBasedMapData, MapData mapData) - { - var wmtsMapData = imageBasedMapData as WmtsMapData; - if (wmtsMapData != null) + var wmtsBackgroundDataConfiguration = backgroundData.Configuration as WmtsBackgroundDataConfiguration; + if (wmtsBackgroundDataConfiguration != null) { - AssertWmtsMapData(wmtsMapData, mapData); + Assert.IsInstanceOf(imageBasedMapData); + + var wmtsMapData = (WmtsMapData) imageBasedMapData; + Assert.AreEqual(wmtsBackgroundDataConfiguration.PreferredFormat, wmtsMapData.PreferredFormat); + Assert.AreEqual(wmtsBackgroundDataConfiguration.SelectedCapabilityIdentifier, wmtsMapData.SelectedCapabilityIdentifier); + Assert.AreEqual(wmtsBackgroundDataConfiguration.SourceCapabilitiesUrl, wmtsMapData.SourceCapabilitiesUrl); + Assert.AreEqual(wmtsBackgroundDataConfiguration.IsConfigured, wmtsMapData.IsConfigured); + return; } - var wellKnownTileSourceMapData = imageBasedMapData as WellKnownTileSourceMapData; - if (wellKnownTileSourceMapData != null) + var wellKnownBackgroundDataConfiguration = backgroundData.Configuration as WellKnownBackgroundDataConfiguration; + if (wellKnownBackgroundDataConfiguration != null) { - AssertWellKnownTileSourceMapData(wellKnownTileSourceMapData, mapData); + Assert.IsInstanceOf(imageBasedMapData); + + var wellKnownTileSourceMapData = (WellKnownTileSourceMapData) imageBasedMapData; + Assert.AreEqual(wellKnownBackgroundDataConfiguration.WellKnownTileSource, (RingtoetsWellKnownTileSource) wellKnownTileSourceMapData.TileSource); + Assert.IsTrue(wellKnownTileSourceMapData.IsConfigured); + return; } - Assert.IsInstanceOf(imageBasedMapData); - Assert.Fail($"unknown type of {nameof(ImageBasedMapData)}"); - } - private static void AssertWellKnownTileSourceMapData(WellKnownTileSourceMapData wellKnownTileSourceMapData, MapData mapData) - { - Assert.IsInstanceOf(mapData); - Assert.IsNotNull(wellKnownTileSourceMapData); - Assert.AreEqual(wellKnownTileSourceMapData.Name, mapData.Name); - Assert.AreEqual(wellKnownTileSourceMapData.IsVisible, mapData.IsVisible); - - var actualMapData = (WellKnownTileSourceMapData) mapData; - Assert.AreEqual(wellKnownTileSourceMapData.IsConfigured, actualMapData.IsConfigured); - Assert.AreEqual(wellKnownTileSourceMapData.Transparency, actualMapData.Transparency); - Assert.AreEqual(wellKnownTileSourceMapData.TileSource, actualMapData.TileSource); + Assert.Fail("Unsupported background configuration."); } private static Point2D[] GetWorldPoints(ForeshoreProfile foreshoreProfile) Index: Ringtoets/Common/test/Ringtoets.Common.Utils.Test/TypeConverters/BackgroundDataConverterTest.cs =================================================================== diff -u -r5c1a60942a2effc207d546054d4832f4aabe8ba5 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Common/test/Ringtoets.Common.Utils.Test/TypeConverters/BackgroundDataConverterTest.cs (.../BackgroundDataConverterTest.cs) (revision 5c1a60942a2effc207d546054d4832f4aabe8ba5) +++ Ringtoets/Common/test/Ringtoets.Common.Utils.Test/TypeConverters/BackgroundDataConverterTest.cs (.../BackgroundDataConverterTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -34,7 +34,7 @@ namespace Ringtoets.Common.Utils.Test.TypeConverters { [TestFixture] - public class BackgroundDataConverterTestW + public class BackgroundDataConverterTest { private static IEnumerable WmtsMapDatas { @@ -103,7 +103,7 @@ { // Setup var random = new Random(21); - WellKnownTileSource wellKnownTileSource = random.NextEnumValue(); + var wellKnownTileSource = random.NextEnumValue(); var mapData = new WellKnownTileSourceMapData(wellKnownTileSource); // Call @@ -156,23 +156,22 @@ ImageBasedMapData convertedMapData = BackgroundDataConverter.ConvertFrom(backgroundData); // Assert - MapDataTestHelper.AssertImageBasedMapData(mapData, convertedMapData); + MapDataTestHelper.AssertImageBasedMapData(backgroundData, convertedMapData); } [Test] public void ConvertFrom_BackgroundData_ReturnWellKnownMapData() { // Setup var random = new Random(21); - RingtoetsWellKnownTileSource wellKnownTileSource = random.NextEnumValue(); + var wellKnownTileSource = random.NextEnumValue(); BackgroundData backgroundData = BackgroundDataTestDataGenerator.GetWellKnownBackgroundMapData(wellKnownTileSource); // Call ImageBasedMapData convertedMapData = BackgroundDataConverter.ConvertFrom(backgroundData); // Assert - var expectedMapData = new WellKnownTileSourceMapData((WellKnownTileSource) wellKnownTileSource); - MapDataTestHelper.AssertImageBasedMapData(expectedMapData, convertedMapData); + MapDataTestHelper.AssertImageBasedMapData(backgroundData, convertedMapData); } [Test] Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -177,9 +177,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -230,7 +228,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -265,7 +263,7 @@ view.Data = failureMechanismContext; - var duneLocationsMapData = map.Data.Collection.ElementAt(duneLocationsIndex); + MapData duneLocationsMapData = map.Data.Collection.ElementAt(duneLocationsIndex); // Precondition AssertDuneLocationsMapData(failureMechanism.DuneLocations, duneLocationsMapData); @@ -301,7 +299,7 @@ view.Data = failureMechanismContext; - var duneLocationsMapData = map.Data.Collection.ElementAt(duneLocationsIndex); + MapData duneLocationsMapData = map.Data.Collection.ElementAt(duneLocationsIndex); // Precondition AssertDuneLocationsMapData(failureMechanism.DuneLocations, duneLocationsMapData); @@ -333,7 +331,7 @@ }; view.Data = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); - var duneLocationsMapData = map.Data.Collection.ElementAt(duneLocationsIndex); + MapData duneLocationsMapData = map.Data.Collection.ElementAt(duneLocationsIndex); // Precondition AssertDuneLocationsMapData(failureMechanism.DuneLocations, duneLocationsMapData); @@ -378,7 +376,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -444,7 +442,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -473,7 +471,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -562,7 +560,7 @@ private static void AssertDuneLocationsMapData(IEnumerable duneLocations, MapData mapData) { Assert.IsInstanceOf(mapData); - MapPointData duneLocationsMapData = (MapPointData) mapData; + var duneLocationsMapData = (MapPointData) mapData; if (duneLocations == null) { CollectionAssert.IsEmpty(duneLocationsMapData.Features); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -26,6 +26,7 @@ using Core.Components.DotSpatial.Forms; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; +using Core.Components.Gis.Geometries; using NUnit.Framework; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; @@ -178,9 +179,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -267,7 +266,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -315,7 +314,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase1.Locations, hydraulicBoundaryLocationsMapData); @@ -355,7 +354,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -400,7 +399,7 @@ view.Data = new GrassCoverErosionInwardsFailureMechanismContext(new GrassCoverErosionInwardsFailureMechanism(), assessmentSection); - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(currentHydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -446,7 +445,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -509,7 +508,7 @@ view.Data = failureMechanismContext; - var dikeProfileData = map.Data.Collection.ElementAt(dikeProfilesIndex); + MapData dikeProfileData = map.Data.Collection.ElementAt(dikeProfilesIndex); // Precondition AssertDikeProfiles(failureMechanism.DikeProfiles, dikeProfileData); @@ -543,7 +542,7 @@ view.Data = failureMechanismContext; - var dikeProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); + MapData dikeProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); // Precondition MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.DikeProfiles.Select(dp => dp.ForeshoreProfile), dikeProfileData); @@ -703,7 +702,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -741,7 +740,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -819,9 +818,9 @@ Assert.IsInstanceOf(mapData); Assert.AreEqual(dikeProfileArray.Length, dikeProfilesData.Features.Length); - for (int i = 0; i < dikeProfileArray.Length; i++) + for (var i = 0; i < dikeProfileArray.Length; i++) { - var profileDataA = dikeProfilesData.Features[i].MapGeometries.First(); + MapGeometry profileDataA = dikeProfilesData.Features[i].MapGeometries.First(); CollectionAssert.AreEquivalent(dikeProfileArray[0].DikeGeometry, profileDataA.PointCollections.First()); } @@ -836,7 +835,7 @@ var calculationsFeatures = calculationsMapData.Features.ToArray(); Assert.AreEqual(calculationsArray.Length, calculationsFeatures.Length); - for (int index = 0; index < calculationsArray.Length; index++) + for (var index = 0; index < calculationsArray.Length; index++) { var geometries = calculationsFeatures[index].MapGeometries.ToArray(); Assert.AreEqual(1, geometries.Length); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -179,9 +179,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -260,7 +258,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -296,7 +294,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(failureMechanism.HydraulicBoundaryLocations, hydraulicBoundaryLocationsMapData); @@ -340,7 +338,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -405,7 +403,7 @@ view.Data = failureMechanismContext; - var foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); + MapData foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); // Precondition MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, foreshoreProfileData); @@ -563,7 +561,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -598,7 +596,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -671,7 +669,7 @@ var calculationsFeatures = calculationsMapData.Features.ToArray(); Assert.AreEqual(calculationsArray.Length, calculationsFeatures.Length); - for (int index = 0; index < calculationsArray.Length; index++) + for (var index = 0; index < calculationsArray.Length; index++) { var geometries = calculationsFeatures[index].MapGeometries.ToArray(); Assert.AreEqual(1, geometries.Length); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs =================================================================== diff -u -rb6c0d3a160059b4f7c428b3b51ae923e59104bb1 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision b6c0d3a160059b4f7c428b3b51ae923e59104bb1) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -26,6 +26,7 @@ using Core.Components.DotSpatial.Forms; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; +using Core.Components.Gis.Geometries; using NUnit.Framework; using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; @@ -184,9 +185,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -277,7 +276,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -327,7 +326,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase1.Locations, hydraulicBoundaryLocationsMapData); @@ -366,7 +365,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -410,7 +409,7 @@ view.Data = new HeightStructuresFailureMechanismContext(new HeightStructuresFailureMechanism(), assessmentSection); - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(currentHydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -456,7 +455,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -521,7 +520,7 @@ view.Data = failureMechanismContext; - var foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); + MapData foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); // Precondition MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, foreshoreProfileData); @@ -554,7 +553,7 @@ view.Data = failureMechanismContext; - var structuresData = map.Data.Collection.ElementAt(structuresIndex); + MapData structuresData = map.Data.Collection.ElementAt(structuresIndex); // Precondition AssertStructures(failureMechanism.HeightStructures, structuresData); @@ -719,7 +718,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -757,7 +756,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -834,9 +833,9 @@ Assert.AreEqual(structuresArray.Length, structuresData.Features.Length); - for (int i = 0; i < structuresArray.Length; i++) + for (var i = 0; i < structuresArray.Length; i++) { - var profileDataA = structuresData.Features[i].MapGeometries.First(); + MapGeometry profileDataA = structuresData.Features[i].MapGeometries.First(); Assert.AreEqual(structuresArray[0].Location, profileDataA.PointCollections.First().First()); } @@ -851,7 +850,7 @@ var calculationsFeatures = calculationsMapData.Features.ToArray(); Assert.AreEqual(calculationsArray.Length, calculationsFeatures.Length); - for (int index = 0; index < calculationsArray.Length; index++) + for (var index = 0; index < calculationsArray.Length; index++) { var geometries = calculationsFeatures[index].MapGeometries.ToArray(); Assert.AreEqual(1, geometries.Length); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -158,9 +158,7 @@ // Assert Assert.AreSame(assessmentSection, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -218,7 +216,7 @@ assessmentSection.HydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(1, "test", 1.0, 2.0)); view.Data = assessmentSection; - var mapData = view.Map.Data; + MapDataCollection mapData = view.Map.Data; // Precondition AssertHydraulicBoundaryDatabaseData(mapData, assessmentSection.HydraulicBoundaryDatabase); @@ -247,7 +245,7 @@ assessmentSection.HydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(1, "test", 1.0, 2.0)); view.Data = assessmentSection; - var mapData = view.Map.Data; + MapDataCollection mapData = view.Map.Data; // Precondition AssertHydraulicBoundaryDatabaseData(mapData, assessmentSection.HydraulicBoundaryDatabase); @@ -289,7 +287,7 @@ assessmentSection.ReferenceLine.SetGeometry(points); view.Data = assessmentSection; - var mapData = view.Map.Data; + MapDataCollection mapData = view.Map.Data; // Precondition AssertReferenceLineData(mapData, assessmentSection.ReferenceLine); @@ -360,7 +358,7 @@ MapDataCollection mapData = view.Map.Data; - var dataToMove = mapData.Collection.ElementAt(0); + MapData dataToMove = mapData.Collection.ElementAt(0); mapData.Remove(dataToMove); mapData.Add(dataToMove); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -r49a3564d07407c2877d9562a8eda8a04fb368558 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision 49a3564d07407c2877d9562a8eda8a04fb368558) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -162,9 +162,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -308,9 +306,9 @@ stochasticSoilModel2 }, arbitraryFilePath); - var calculationA = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); + PipingCalculationScenario calculationA = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); calculationA.InputParameters.SurfaceLine = surfaceLineA; - var calculationB = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); + PipingCalculationScenario calculationB = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); calculationB.InputParameters.SurfaceLine = surfaceLineB; failureMechanism.CalculationsGroup.Children.Add(calculationA); failureMechanism.CalculationsGroup.Children.Add(calculationB); @@ -323,7 +321,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -382,7 +380,7 @@ observers[calculationsIndex].Expect(obs => obs.UpdateObserver()); mocks.ReplayAll(); - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase1.Locations, hydraulicBoundaryLocationsMapData); @@ -426,7 +424,7 @@ observers[hydraulicBoundaryLocationsIndex].Expect(obs => obs.UpdateObserver()); mocks.ReplayAll(); - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -483,7 +481,7 @@ observers[calculationsIndex].Expect(obs => obs.UpdateObserver()); mocks.ReplayAll(); - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(currentHydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -540,7 +538,7 @@ observers[calculationsIndex].Expect(obs => obs.UpdateObserver()); mocks.ReplayAll(); - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -750,9 +748,9 @@ surfaceLineA.ReferenceLineIntersectionWorldPoint = new Point2D(1.3, 1.3); surfaceLineB.ReferenceLineIntersectionWorldPoint = new Point2D(1.5, 1.5); - var calculationA = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); + PipingCalculationScenario calculationA = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); calculationA.InputParameters.SurfaceLine = surfaceLineA; - var calculationB = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); + PipingCalculationScenario calculationB = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); calculationB.InputParameters.SurfaceLine = surfaceLineB; failureMechanism.CalculationsGroup.Children.Add(calculationA); @@ -800,7 +798,7 @@ surfaceLineA.ReferenceLineIntersectionWorldPoint = new Point2D(1.3, 1.3); surfaceLineB.ReferenceLineIntersectionWorldPoint = new Point2D(1.5, 1.5); - var calculationA = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); + PipingCalculationScenario calculationA = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); calculationA.InputParameters.SurfaceLine = surfaceLineA; var failureMechanism = new PipingFailureMechanism(); @@ -851,7 +849,7 @@ surfaceLineA.ReferenceLineIntersectionWorldPoint = new Point2D(1.3, 1.3); surfaceLineB.ReferenceLineIntersectionWorldPoint = new Point2D(1.5, 1.5); - var calculationA = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); + PipingCalculationScenario calculationA = PipingCalculationScenarioFactory.CreatePipingCalculationScenarioWithValidInput(); calculationA.InputParameters.SurfaceLine = surfaceLineA; var failureMechanism = new PipingFailureMechanism(); @@ -901,7 +899,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -939,7 +937,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -1015,10 +1013,10 @@ var surfaceLinesArray = surfaceLines.ToArray(); Assert.AreEqual(surfaceLinesArray.Length, surfacelineFeatures.Length); - for (int index = 0; index < surfaceLinesArray.Length; index++) + for (var index = 0; index < surfaceLinesArray.Length; index++) { Assert.AreEqual(1, surfacelineFeatures[index].MapGeometries.Count()); - var surfaceLine = surfaceLinesArray[index]; + RingtoetsPipingSurfaceLine surfaceLine = surfaceLinesArray[index]; CollectionAssert.AreEquivalent(surfaceLine.Points.Select(p => new Point2D(p.X, p.Y)), surfacelineFeatures[index].MapGeometries.First().PointCollections.First()); } Assert.AreEqual("Profielschematisaties", mapData.Name); @@ -1032,10 +1030,10 @@ var stochasticSoilModelsArray = soilModels.ToArray(); Assert.AreEqual(stochasticSoilModelsArray.Length, soilModelsFeatures.Length); - for (int index = 0; index < stochasticSoilModelsArray.Length; index++) + for (var index = 0; index < stochasticSoilModelsArray.Length; index++) { Assert.AreEqual(1, soilModelsFeatures[index].MapGeometries.Count()); - var stochasticSoilModel = stochasticSoilModelsArray[index]; + StochasticSoilModel stochasticSoilModel = stochasticSoilModelsArray[index]; CollectionAssert.AreEquivalent(stochasticSoilModel.Geometry.Select(p => new Point2D(p.X, p.Y)), soilModelsFeatures[index].MapGeometries.First().PointCollections.First()); } Assert.AreEqual("Stochastische ondergrondmodellen", mapData.Name); @@ -1049,7 +1047,7 @@ var calculationsFeatures = calculationsMapData.Features.ToArray(); Assert.AreEqual(calculationsArray.Length, calculationsFeatures.Length); - for (int index = 0; index < calculationsArray.Length; index++) + for (var index = 0; index < calculationsArray.Length; index++) { var geometries = calculationsFeatures[index].MapGeometries.ToArray(); Assert.AreEqual(1, geometries.Length); Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismViewTest.cs (.../StabilityPointStructuresFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -26,6 +26,7 @@ using Core.Components.DotSpatial.Forms; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; +using Core.Components.Gis.Geometries; using NUnit.Framework; using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; @@ -184,9 +185,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -277,7 +276,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -327,7 +326,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase1.Locations, hydraulicBoundaryLocationsMapData); @@ -366,7 +365,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -410,7 +409,7 @@ view.Data = new StabilityPointStructuresFailureMechanismContext(new StabilityPointStructuresFailureMechanism(), assessmentSection); - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(currentHydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -456,7 +455,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -521,7 +520,7 @@ view.Data = failureMechanismContext; - var foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); + MapData foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); // Precondition MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, foreshoreProfileData); @@ -554,7 +553,7 @@ view.Data = failureMechanismContext; - var structuresData = map.Data.Collection.ElementAt(structuresIndex); + MapData structuresData = map.Data.Collection.ElementAt(structuresIndex); // Precondition AssertStructures(failureMechanism.StabilityPointStructures, structuresData); @@ -719,7 +718,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -757,7 +756,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -834,9 +833,9 @@ Assert.AreEqual(structuresArray.Length, structuresData.Features.Length); - for (int i = 0; i < structuresArray.Length; i++) + for (var i = 0; i < structuresArray.Length; i++) { - var profileDataA = structuresData.Features[i].MapGeometries.First(); + MapGeometry profileDataA = structuresData.Features[i].MapGeometries.First(); Assert.AreEqual(structuresArray[0].Location, profileDataA.PointCollections.First().First()); } @@ -851,7 +850,7 @@ var calculationsFeatures = calculationsMapData.Features.ToArray(); Assert.AreEqual(calculationsArray.Length, calculationsFeatures.Length); - for (int index = 0; index < calculationsArray.Length; index++) + for (var index = 0; index < calculationsArray.Length; index++) { var geometries = calculationsFeatures[index].MapGeometries.ToArray(); Assert.AreEqual(1, geometries.Length); Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs =================================================================== diff -u -r9c23520df7a2adf82996d79bf59b83fc1adc1f26 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision 9c23520df7a2adf82996d79bf59b83fc1adc1f26) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverFailureMechanismViewTest.cs (.../StabilityStoneCoverFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -180,9 +180,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -269,7 +267,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -316,7 +314,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase1.Locations, hydraulicBoundaryLocationsMapData); @@ -355,7 +353,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -399,7 +397,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -464,7 +462,7 @@ view.Data = failureMechanismContext; - var foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); + MapData foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); // Precondition MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, foreshoreProfileData); @@ -622,7 +620,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -657,7 +655,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -730,7 +728,7 @@ var calculationsFeatures = calculationsMapData.Features.ToArray(); Assert.AreEqual(calculationsArray.Length, calculationsFeatures.Length); - for (int index = 0; index < calculationsArray.Length; index++) + for (var index = 0; index < calculationsArray.Length; index++) { var geometries = calculationsFeatures[index].MapGeometries.ToArray(); Assert.AreEqual(1, geometries.Length); Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs =================================================================== diff -u -ra1a0212c2ed8572ed8414f77172bd698441e58b7 -rf2582640849a5a4afce5674db823c37e1edaea19 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision a1a0212c2ed8572ed8414f77172bd698441e58b7) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismViewTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewTest.cs) (revision f2582640849a5a4afce5674db823c37e1edaea19) @@ -180,9 +180,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); AssertEmptyMapData(view.Map.Data); - ImageBasedMapData expectedImageBasedMapData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData( - assessmentSection.BackgroundData); - MapDataTestHelper.AssertImageBasedMapData(expectedImageBasedMapData, view.Map.BackgroundMapData); + MapDataTestHelper.AssertImageBasedMapData(assessmentSection.BackgroundData, view.Map.BackgroundMapData); } } @@ -269,7 +267,7 @@ // Assert Assert.AreSame(failureMechanismContext, view.Data); - var mapData = map.Data; + MapDataCollection mapData = map.Data; Assert.IsInstanceOf(mapData); var mapDataList = mapData.Collection.ToList(); @@ -317,7 +315,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase1.Locations, hydraulicBoundaryLocationsMapData); @@ -356,7 +354,7 @@ view.Data = failureMechanismContext; - var hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); + MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); @@ -400,7 +398,7 @@ view.Data = failureMechanismContext; - var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); + MapData referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); @@ -465,7 +463,7 @@ view.Data = failureMechanismContext; - var foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); + MapData foreshoreProfileData = map.Data.Collection.ElementAt(foreshoreProfilesIndex); // Precondition MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, foreshoreProfileData); @@ -623,7 +621,7 @@ view.Data = failureMechanismContext; - var mapData = map.Data; + MapDataCollection mapData = map.Data; var dataToMove = (MapLineData) map.Data.Collection.ElementAt(referenceLineIndex); mapData.Remove(dataToMove); @@ -658,7 +656,7 @@ new Point2D(2.0, 5.0), new Point2D(4.0, 3.0) }; - ReferenceLine referenceLine = new ReferenceLine(); + var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(points); assessmentSection.ReferenceLine = referenceLine; @@ -731,7 +729,7 @@ var calculationsFeatures = calculationsMapData.Features.ToArray(); Assert.AreEqual(calculationsArray.Length, calculationsFeatures.Length); - for (int index = 0; index < calculationsArray.Length; index++) + for (var index = 0; index < calculationsArray.Length; index++) { var geometries = calculationsFeatures[index].MapGeometries.ToArray(); Assert.AreEqual(1, geometries.Length);