Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs =================================================================== diff -u -r325d885b0c90df169364b1afee4a9b176f081d56 -ra76c963dc2f487204029c90e1cbdd0e4eaeb0de5 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision 325d885b0c90df169364b1afee4a9b176f081d56) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismViewTest.cs (.../HeightStructuresFailureMechanismViewTest.cs) (revision a76c963dc2f487204029c90e1cbdd0e4eaeb0de5) @@ -240,10 +240,10 @@ var mapDataList = mapData.Collection.ToList(); Assert.AreEqual(8, mapDataList.Count); - AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, mapDataList[referenceLineIndex]); MapDataTestHelper.AssertFailureMechanismSectionsMapData(failureMechanism.Sections, mapDataList[sectionsIndex]); - AssertFailureMechanismSectionsStartPointMapData(failureMechanism.Sections, mapDataList[sectionsStartPointIndex]); - AssertFailureMechanismSectionsEndPointMapData(failureMechanism.Sections, mapDataList[sectionsEndPointIndex]); + MapDataTestHelper.AssertFailureMechanismSectionsStartPointMapData(failureMechanism.Sections, mapDataList[sectionsStartPointIndex]); + MapDataTestHelper.AssertFailureMechanismSectionsEndPointMapData(failureMechanism.Sections, mapDataList[sectionsEndPointIndex]); MapDataTestHelper.AssertHydraulicBoundaryLocationsMapData(hydraulicBoundaryDatabase.Locations, mapDataList[hydraulicBoundaryLocationsIndex]); AssertForeshoreProfiles(failureMechanism.ForeshoreProfiles, mapDataList[foreshoreProfilesIndex]); AssertCalculationsMapData( @@ -416,14 +416,14 @@ var referenceLineMapData = map.Data.Collection.ElementAt(referenceLineIndex); // Precondition - AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); // Call assessmentSection.ReferenceLine.SetGeometry(points2); assessmentSection.NotifyObservers(); // Assert - AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); + MapDataTestHelper.AssertReferenceLineMapData(assessmentSection.ReferenceLine, referenceLineMapData); } } @@ -454,8 +454,8 @@ // Assert MapDataTestHelper.AssertFailureMechanismSectionsMapData(failureMechanism.Sections, sectionMapData); - AssertFailureMechanismSectionsStartPointMapData(failureMechanism.Sections, sectionStartsMapData); - AssertFailureMechanismSectionsEndPointMapData(failureMechanism.Sections, sectionsEndsMapData); + MapDataTestHelper.AssertFailureMechanismSectionsStartPointMapData(failureMechanism.Sections, sectionStartsMapData); + MapDataTestHelper.AssertFailureMechanismSectionsEndPointMapData(failureMechanism.Sections, sectionsEndsMapData); } } @@ -774,21 +774,6 @@ } } - private static void AssertReferenceLineMapData(ReferenceLine referenceLine, MapData mapData) - { - Assert.IsInstanceOf(mapData); - var referenceLineData = (MapLineData) mapData; - if (referenceLine == null) - { - CollectionAssert.IsEmpty(referenceLineData.Features.First().MapGeometries.First().PointCollections.First()); - } - else - { - CollectionAssert.AreEqual(referenceLine.Points, referenceLineData.Features.First().MapGeometries.First().PointCollections.First()); - } - Assert.AreEqual("Referentielijn", mapData.Name); - } - private static void AssertForeshoreProfiles(IEnumerable foreshoreProfiles, MapData mapData) { Assert.NotNull(foreshoreProfiles, "foreshoreProfiles should never be null."); @@ -825,22 +810,6 @@ Assert.AreEqual("Kunstwerken", mapData.Name); } - private static void AssertFailureMechanismSectionsStartPointMapData(IEnumerable sections, MapData mapData) - { - Assert.IsInstanceOf(mapData); - var sectionsStartPointData = (MapPointData) mapData; - CollectionAssert.AreEqual(sections.Select(s => s.GetStart()), sectionsStartPointData.Features.First().MapGeometries.First().PointCollections.First()); - Assert.AreEqual("Vakindeling (startpunten)", mapData.Name); - } - - private static void AssertFailureMechanismSectionsEndPointMapData(IEnumerable sections, MapData mapData) - { - Assert.IsInstanceOf(mapData); - var sectionsStartPointData = (MapPointData) mapData; - CollectionAssert.AreEqual(sections.Select(s => s.GetLast()), sectionsStartPointData.Features.First().MapGeometries.First().PointCollections.First()); - Assert.AreEqual("Vakindeling (eindpunten)", mapData.Name); - } - private static void AssertCalculationsMapData(IEnumerable> calculations, MapData mapData) { Assert.IsInstanceOf(mapData);