Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapDataTestHelperTest.cs =================================================================== diff -u -r048b1d235b217310417c6b9367deffe030d30572 -rd168cfa3e426f88b3ae1318268afacc7675c6fa6 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapDataTestHelperTest.cs (.../MapDataTestHelperTest.cs) (revision 048b1d235b217310417c6b9367deffe030d30572) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapDataTestHelperTest.cs (.../MapDataTestHelperTest.cs) (revision d168cfa3e426f88b3ae1318268afacc7675c6fa6) @@ -32,7 +32,6 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Util.TypeConverters; @@ -195,108 +194,6 @@ #endregion - #region AssertHydraulicBoundaryLocationsMapData - - [Test] - public void AssertHydraulicBoundaryLocationsMapData_MapDataNotPointData_ThrowAssertionException() - { - // Setup - var mapData = new MapLineData("Hydraulische randvoorwaarden"); - - // Call - TestDelegate test = () => MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(Enumerable.Empty(), mapData); - - // Assert - Assert.Throws(test); - } - - [Test] - public void AssertHydraulicBoundaryLocationsMapData_FeaturesNotSameAsLocations_ThrowAssertionException() - { - // Setup - IEnumerable hydraulicBoundaryLocations = new[] - { - new HydraulicBoundaryLocation(1, "test1", 1, 0) - }; - - var mapData = new MapPointData("Hydraulische randvoorwaarden"); - - // Call - TestDelegate test = () => MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryLocations, mapData); - - // Assert - Assert.Throws(test); - } - - [Test] - public void AssertHydraulicBoundaryLocationsMapData_FeatureGeometryNotSameAsLocations_ThrowAssertionException() - { - // Setup - IEnumerable hydraulicBoundaryLocations = new[] - { - new HydraulicBoundaryLocation(1, "test1", 1, 0) - }; - - var mapData = new MapPointData("Hydraulische randvoorwaarden") - { - Features = new[] - { - new MapFeature(new[] - { - new MapGeometry(new[] - { - new[] - { - new Point2D(0, 0) - } - }) - }) - } - }; - - // Call - TestDelegate test = () => MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryLocations, mapData); - - // Assert - Assert.Throws(test); - } - - [Test] - public void AssertHydraulicBoundaryLocationsMapData_WithHydraulicBoundaryLocationsMapDataCorrect_DoesNotThrow() - { - // Setup - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test1", 1, 0); - IEnumerable hydraulicBoundaryLocations = new[] - { - hydraulicBoundaryLocation - }; - - var mapData = new MapPointData("Hydraulische randvoorwaarden") - { - Features = new[] - { - new MapFeature(new[] - { - new MapGeometry(new[] - { - new[] - { - new Point2D(1, 0) - } - }) - }) - } - }; - - // Call - TestDelegate test = () => MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryLocations, mapData); - - // Assert - Assert.DoesNotThrow(test); - } - - #endregion - #region AssertReferenceLineMapData [Test] Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapDataTestHelper.cs =================================================================== diff -u -rf6e74516582b0e5c854526d50a90db1216417d9d -rd168cfa3e426f88b3ae1318268afacc7675c6fa6 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapDataTestHelper.cs (.../MapDataTestHelper.cs) (revision f6e74516582b0e5c854526d50a90db1216417d9d) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapDataTestHelper.cs (.../MapDataTestHelper.cs) (revision d168cfa3e426f88b3ae1318268afacc7675c6fa6) @@ -31,7 +31,6 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.Hydraulics; namespace Ringtoets.Common.Forms.TestUtil { @@ -72,33 +71,6 @@ } /// - /// Asserts whether the contains the data that is representative for the . - /// - /// The hydraulic boundary locations that contain the original data. - /// The that needs to be asserted. - /// Thrown when: - /// - /// is not ; - /// the name of the is not "Hydraulische randvoorwaarden"; - /// 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); - - var hydraulicLocationsMapData = (MapPointData) mapData; - - HydraulicBoundaryLocation[] hydraulicBoundaryLocationsArray = hydraulicBoundaryLocations.ToArray(); - - Assert.AreEqual(hydraulicBoundaryLocationsArray.Length, hydraulicLocationsMapData.Features.Count()); - CollectionAssert.AreEqual(hydraulicBoundaryLocationsArray.Select(hrp => hrp.Location), - hydraulicLocationsMapData.Features.SelectMany(f => f.MapGeometries.First().PointCollections.First())); - } - - /// /// Asserts whether the contains the data that is representative for the data of /// hydraulic boundary locations and calculations in . /// Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs =================================================================== diff -u -r16f9859775bbc8cb7af04dbd2a30ac8be9e93cdd -rd168cfa3e426f88b3ae1318268afacc7675c6fa6 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision 16f9859775bbc8cb7af04dbd2a30ac8be9e93cdd) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismViewTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewTest.cs) (revision d168cfa3e426f88b3ae1318268afacc7675c6fa6) @@ -231,7 +231,7 @@ MapDataTestHelper.AssertFailureMechanismSectionsMapData(failureMechanism.Sections, mapDataList[sectionsIndex]); MapDataTestHelper.AssertFailureMechanismSectionsStartPointMapData(failureMechanism.Sections, mapDataList[sectionsStartPointIndex]); MapDataTestHelper.AssertFailureMechanismSectionsEndPointMapData(failureMechanism.Sections, mapDataList[sectionsEndPointIndex]); - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection.HydraulicBoundaryDatabase.Locations, mapDataList[hydraulicBoundaryLocationsIndex]); + GrassCoverErosionOutwardsMapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(failureMechanism, assessmentSection, mapDataList[hydraulicBoundaryLocationsIndex]); MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); AssertCalculationsMapData(failureMechanism.Calculations.Cast(), mapDataList[calculationsIndex]); @@ -262,7 +262,7 @@ MapData hydraulicBoundaryLocationsMapData = map.Data.Collection.ElementAt(hydraulicBoundaryLocationsIndex); // Precondition - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection.HydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); + GrassCoverErosionOutwardsMapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(failureMechanism, assessmentSection, hydraulicBoundaryLocationsMapData); // When GrassCoverErosionOutwardsHydraulicBoundaryLocationsTestHelper.AddHydraulicBoundaryLocations(failureMechanism, assessmentSection, new[] @@ -273,7 +273,7 @@ assessmentSection.HydraulicBoundaryDatabase.Locations.NotifyObservers(); // Then - MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(assessmentSection.HydraulicBoundaryDatabase.Locations, hydraulicBoundaryLocationsMapData); + GrassCoverErosionOutwardsMapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(failureMechanism, assessmentSection, hydraulicBoundaryLocationsMapData); mocks.VerifyAll(); } }