Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/DikeProfilesImporterTest.cs =================================================================== diff -u -r355010200cb0321da0786bc1170c396c64e2845e -r59c2ee32cb47c49461cf11d5aea1d78f3c230127 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/DikeProfilesImporterTest.cs (.../DikeProfilesImporterTest.cs) (revision 355010200cb0321da0786bc1170c396c64e2845e) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/DikeProfilesImporterTest.cs (.../DikeProfilesImporterTest.cs) (revision 59c2ee32cb47c49461cf11d5aea1d78f3c230127) @@ -120,9 +120,10 @@ string filePath = Path.Combine(fileDirectory, "Voorlanden 12-2.shp"); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var dikeProfilesImporter = new DikeProfilesImporter(failureMechanism.DikeProfiles, referenceLine, filePath); + var dikeProfiles = new ObservableList(); + var dikeProfilesImporter = new DikeProfilesImporter(dikeProfiles, referenceLine, filePath); + // Call bool importResult = false; Action call = () => importResult = dikeProfilesImporter.Import(); @@ -138,7 +139,7 @@ }; TestHelper.AssertLogMessagesAreGenerated(call, expectedMessages); Assert.IsTrue(importResult); - Assert.AreEqual(0, failureMechanism.DikeProfiles.Count); + Assert.AreEqual(0, dikeProfiles.Count); } [Test] @@ -148,7 +149,6 @@ string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var referencePoints = new List { new Point2D(131223.2, 548393.4), @@ -160,7 +160,8 @@ var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(referencePoints); - var dikeProfilesImporter = new DikeProfilesImporter(failureMechanism.DikeProfiles, referenceLine, filePath); + var dikeProfiles = new ObservableList(); + var dikeProfilesImporter = new DikeProfilesImporter(dikeProfiles, referenceLine, filePath); var importResult = false; @@ -171,7 +172,7 @@ string expectedMessage = "Een profiellocatie met ID 'profiel005' ligt niet op de referentielijn. Locatie wordt overgeslagen."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage); Assert.IsTrue(importResult); - Assert.AreEqual(4, failureMechanism.DikeProfiles.Count); + Assert.AreEqual(4, dikeProfiles.Count); } [Test] @@ -182,10 +183,11 @@ Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var progressChangeNotifications = new List(); - var dikeProfilesImporter = new DikeProfilesImporter(failureMechanism.DikeProfiles, referenceLine, filePath) + + var dikeProfiles = new ObservableList(); + var dikeProfilesImporter = new DikeProfilesImporter(dikeProfiles, referenceLine, filePath) { ProgressChanged = (description, step, steps) => { progressChangeNotifications.Add(new ProgressNotification(description, step, steps)); } }; @@ -211,7 +213,7 @@ new ProgressNotification("Inlezen van profielgegevens.", 5, 5) }; ValidateProgressMessages(expectedProgressMessages, progressChangeNotifications); - Assert.AreEqual(5, failureMechanism.DikeProfiles.Count); + Assert.AreEqual(5, dikeProfiles.Count); } [Test] @@ -222,15 +224,15 @@ Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var dikeProfilesImporter = new DikeProfilesImporter(failureMechanism.DikeProfiles, referenceLine, filePath); + var dikeProfiles = new ObservableList(); + var dikeProfilesImporter = new DikeProfilesImporter(dikeProfiles, referenceLine, filePath); // Call dikeProfilesImporter.Import(); // Assert - DikeProfile dikeProfile = failureMechanism.DikeProfiles[4]; + DikeProfile dikeProfile = dikeProfiles[4]; Assert.AreEqual(new Point2D(136039.49100000039, 533920.28050000477), dikeProfile.WorldReferencePoint); Assert.AreEqual("profiel005", dikeProfile.Name); Assert.AreEqual(15.56165507, dikeProfile.X0); @@ -247,10 +249,11 @@ Path.Combine("DikeProfiles", "AllDamTypes", "Voorlanden 12-2.shp")); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var progressChangeNotifications = new List(); - var dikeProfilesImporter = new DikeProfilesImporter(failureMechanism.DikeProfiles, referenceLine, filePath) + + var dikeProfiles = new ObservableList(); + var dikeProfilesImporter = new DikeProfilesImporter(dikeProfiles, referenceLine, filePath) { ProgressChanged = (description, step, steps) => progressChangeNotifications.Add(new ProgressNotification(description, step, steps)) }; @@ -276,7 +279,7 @@ new ProgressNotification("Inlezen van profielgegevens.", 5, 5) }; ValidateProgressMessages(expectedProgressMessages, progressChangeNotifications); - Assert.AreEqual(5, failureMechanism.DikeProfiles.Count); + Assert.AreEqual(5, dikeProfiles.Count); } [Test] @@ -287,9 +290,9 @@ Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var dikeProfilesImporter = new DikeProfilesImporter(failureMechanism.DikeProfiles, referenceLine, filePath); + var dikeProfiles = new ObservableList(); + var dikeProfilesImporter = new DikeProfilesImporter(dikeProfiles, referenceLine, filePath); dikeProfilesImporter.Cancel(); bool importResult = true; @@ -310,9 +313,9 @@ Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var dikeProfilesImporter = new DikeProfilesImporter(failureMechanism.DikeProfiles, referenceLine, filePath); + var dikeProfiles = new ObservableList(); + var dikeProfilesImporter = new DikeProfilesImporter(dikeProfiles, referenceLine, filePath); dikeProfilesImporter.Cancel(); bool importResult = dikeProfilesImporter.Import(); @@ -323,7 +326,7 @@ // Assert Assert.IsTrue(importResult); - Assert.AreEqual(5, failureMechanism.DikeProfiles.Count); + Assert.AreEqual(5, dikeProfiles.Count); } private ReferenceLine CreateMatchingReferenceLine() Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/ForeshoreProfilesImporterTest.cs =================================================================== diff -u -re111b5191baff1848429f76f4e8da97e565e4270 -r59c2ee32cb47c49461cf11d5aea1d78f3c230127 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/ForeshoreProfilesImporterTest.cs (.../ForeshoreProfilesImporterTest.cs) (revision e111b5191baff1848429f76f4e8da97e565e4270) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileImporters/ForeshoreProfilesImporterTest.cs (.../ForeshoreProfilesImporterTest.cs) (revision 59c2ee32cb47c49461cf11d5aea1d78f3c230127) @@ -127,16 +127,16 @@ } [Test] - public void Import_FiveForeshoreProfilesWithoutDamsAndGeometries_TrueAndLogWarningAndNoForeshoreProfiles() + public void Import_FiveForeshoreProfilesWithoutDamsAndGeometries_TrueAndLogWarningAndTwoForeshoreProfiles() { // Setup string fileDirectory = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Plugin, Path.Combine("DikeProfiles", "NoDamsAndNoForeshoreGeometries")); string filePath = Path.Combine(fileDirectory, "Voorlanden 12-2.shp"); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); - var foreshoreProfilesImporter = new ForeshoreProfilesImporter(failureMechanism.ForeshoreProfiles, referenceLine, filePath); + var foreshoreProfiles = new ObservableList(); + var foreshoreProfilesImporter = new ForeshoreProfilesImporter(foreshoreProfiles, referenceLine, filePath); // Call bool importResult = false; @@ -146,14 +146,12 @@ string[] expectedMessages = { string.Format("Profielgegevens definiëren geen dam en geen voorlandgeometrie. Bestand '{0}' wordt overgeslagen.", Path.Combine(fileDirectory, "profiel001 - Ringtoets.prfl")), - string.Format("Profielgegevens definiëren geen dam en geen voorlandgeometrie. Bestand '{0}' wordt overgeslagen.", Path.Combine(fileDirectory, "profiel002 - Ringtoets.prfl")), string.Format("Profielgegevens definiëren geen dam en geen voorlandgeometrie. Bestand '{0}' wordt overgeslagen.", Path.Combine(fileDirectory, "profiel003 - Ringtoets.prfl")), string.Format("Profielgegevens definiëren geen dam en geen voorlandgeometrie. Bestand '{0}' wordt overgeslagen.", Path.Combine(fileDirectory, "profiel004 - Ringtoets.prfl")), - string.Format("Profielgegevens definiëren geen dam en geen voorlandgeometrie. Bestand '{0}' wordt overgeslagen.", Path.Combine(fileDirectory, "profiel005 - Ringtoets.prfl")) }; TestHelper.AssertLogMessagesAreGenerated(call, expectedMessages); Assert.IsTrue(importResult); - Assert.AreEqual(0, failureMechanism.ForeshoreProfiles.Count); + Assert.AreEqual(2, foreshoreProfiles.Count); } [Test] @@ -163,7 +161,6 @@ string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); var referencePoints = new List { new Point2D(131223.2, 548393.4), @@ -179,7 +176,8 @@ assessmentSection.ReferenceLine = referenceLine; mockRepository.ReplayAll(); - var foreshoreProfilesImporter = new ForeshoreProfilesImporter(failureMechanism.ForeshoreProfiles, referenceLine, filePath); + var foreshoreProfiles = new ObservableList(); + var foreshoreProfilesImporter = new ForeshoreProfilesImporter(foreshoreProfiles, referenceLine, filePath); // Call var importResult = true; @@ -189,7 +187,7 @@ string expectedMessage = "Een profiellocatie met ID 'profiel005' ligt niet op de referentielijn. Locatie wordt overgeslagen."; TestHelper.AssertLogMessageIsGenerated(call, expectedMessage); Assert.IsTrue(importResult); - Assert.AreEqual(4, failureMechanism.ForeshoreProfiles.Count); + Assert.AreEqual(4, foreshoreProfiles.Count); } [Test] @@ -200,13 +198,13 @@ Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); var assessmentSection = mockRepository.Stub(); assessmentSection.ReferenceLine = referenceLine; mockRepository.ReplayAll(); var progressChangeNotifications = new List(); - var foreshoreProfilesImporter = new ForeshoreProfilesImporter(failureMechanism.ForeshoreProfiles, referenceLine, filePath) + var foreshoreProfiles = new ObservableList(); + var foreshoreProfilesImporter = new ForeshoreProfilesImporter(foreshoreProfiles, referenceLine, filePath) { ProgressChanged = (description, step, steps) => { progressChangeNotifications.Add(new ProgressNotification(description, step, steps)); } }; @@ -232,7 +230,7 @@ new ProgressNotification("Inlezen van profielgegevens.", 5, 5) }; ValidateProgressMessages(expectedProgressMessages, progressChangeNotifications); - Assert.AreEqual(5, failureMechanism.ForeshoreProfiles.Count); + Assert.AreEqual(5, foreshoreProfiles.Count); mockRepository.VerifyAll(); // 'observer' should not be notified } @@ -245,21 +243,21 @@ var observer = mockRepository.StrictMock(); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); var assessmentSection = mockRepository.Stub(); assessmentSection.ReferenceLine = referenceLine; mockRepository.ReplayAll(); - var foreshoreProfilesImporter = new ForeshoreProfilesImporter(failureMechanism.ForeshoreProfiles, referenceLine, filePath); + var foreshoreProfiles = new ObservableList(); + var foreshoreProfilesImporter = new ForeshoreProfilesImporter(foreshoreProfiles, referenceLine, filePath); - var targetContext = new ForeshoreProfilesContext(failureMechanism.ForeshoreProfiles, assessmentSection); + var targetContext = new ForeshoreProfilesContext(foreshoreProfiles, assessmentSection); targetContext.Attach(observer); // Call foreshoreProfilesImporter.Import(); // Assert - ForeshoreProfile foreshoreProfile = targetContext.WrappedData[4]; + ForeshoreProfile foreshoreProfile = foreshoreProfiles[4]; Assert.AreEqual(new Point2D(136039.49100000039, 533920.28050000477), foreshoreProfile.WorldReferencePoint); Assert.AreEqual("profiel005", foreshoreProfile.Name); Assert.AreEqual(15.56165507, foreshoreProfile.X0); @@ -277,18 +275,18 @@ var observer = mockRepository.StrictMock(); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); var assessmentSection = mockRepository.Stub(); assessmentSection.ReferenceLine = referenceLine; mockRepository.ReplayAll(); var progressChangeNotifications = new List(); - var foreshoreProfilesImporter = new ForeshoreProfilesImporter(failureMechanism.ForeshoreProfiles, referenceLine, filePath) + var foreshoreProfiles = new ObservableList(); + var foreshoreProfilesImporter = new ForeshoreProfilesImporter(foreshoreProfiles, referenceLine, filePath) { ProgressChanged = (description, step, steps) => { progressChangeNotifications.Add(new ProgressNotification(description, step, steps)); } }; - var targetContext = new ForeshoreProfilesContext(failureMechanism.ForeshoreProfiles, assessmentSection); + var targetContext = new ForeshoreProfilesContext(foreshoreProfiles, assessmentSection); targetContext.Attach(observer); // Call @@ -312,7 +310,7 @@ new ProgressNotification("Inlezen van profielgegevens.", 5, 5) }; ValidateProgressMessages(expectedProgressMessages, progressChangeNotifications); - Assert.AreEqual(5, targetContext.WrappedData.Count); + Assert.AreEqual(5, foreshoreProfiles.Count); mockRepository.VerifyAll(); // 'observer' should not be notified } @@ -324,12 +322,12 @@ Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); var assessmentSection = mockRepository.Stub(); assessmentSection.ReferenceLine = referenceLine; mockRepository.ReplayAll(); - var foreshoreProfilesImporter = new ForeshoreProfilesImporter(failureMechanism.ForeshoreProfiles, referenceLine, filePath); + var foreshoreProfiles = new ObservableList(); + var foreshoreProfilesImporter = new ForeshoreProfilesImporter(foreshoreProfiles, referenceLine, filePath); // Precondition foreshoreProfilesImporter.Cancel(); @@ -352,15 +350,13 @@ Path.Combine("DikeProfiles", "AllOkTestData", "Voorlanden 12-2.shp")); ReferenceLine referenceLine = CreateMatchingReferenceLine(); - var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); var assessmentSection = mockRepository.Stub(); assessmentSection.ReferenceLine = referenceLine; mockRepository.ReplayAll(); - var targetContext = new ForeshoreProfilesContext(failureMechanism.ForeshoreProfiles, assessmentSection); + var foreshoreProfiles = new ObservableList(); + var foreshoreProfilesImporter = new ForeshoreProfilesImporter(foreshoreProfiles, referenceLine, filePath); - var foreshoreProfilesImporter = new ForeshoreProfilesImporter(failureMechanism.ForeshoreProfiles, referenceLine, filePath); - foreshoreProfilesImporter.Cancel(); bool importResult = foreshoreProfilesImporter.Import(); Assert.IsFalse(importResult); @@ -370,7 +366,7 @@ // Assert Assert.IsTrue(importResult); - Assert.AreEqual(5, targetContext.WrappedData.Count); + Assert.AreEqual(5, foreshoreProfiles.Count); mockRepository.VerifyAll(); // 'observer' should not be notified } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/test-data/DikeProfiles/NoDamsAndNoForeshoreGeometries/profiel002 - Ringtoets.prfl =================================================================== diff -u -r53264d86c84cc30a06519b1b86b7efeee9b6815f -r59c2ee32cb47c49461cf11d5aea1d78f3c230127 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/test-data/DikeProfiles/NoDamsAndNoForeshoreGeometries/profiel002 - Ringtoets.prfl (.../profiel002 - Ringtoets.prfl) (revision 53264d86c84cc30a06519b1b86b7efeee9b6815f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/test-data/DikeProfiles/NoDamsAndNoForeshoreGeometries/profiel002 - Ringtoets.prfl (.../profiel002 - Ringtoets.prfl) (revision 59c2ee32cb47c49461cf11d5aea1d78f3c230127) @@ -3,7 +3,7 @@ RICHTING 330 -DAM 0 +DAM 3 DAMHOOGTE 0 VOORLAND 0 Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/test-data/DikeProfiles/NoDamsAndNoForeshoreGeometries/profiel005 - Ringtoets.prfl =================================================================== diff -u -r53264d86c84cc30a06519b1b86b7efeee9b6815f -r59c2ee32cb47c49461cf11d5aea1d78f3c230127 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/test-data/DikeProfiles/NoDamsAndNoForeshoreGeometries/profiel005 - Ringtoets.prfl (.../profiel005 - Ringtoets.prfl) (revision 53264d86c84cc30a06519b1b86b7efeee9b6815f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/test-data/DikeProfiles/NoDamsAndNoForeshoreGeometries/profiel005 - Ringtoets.prfl (.../profiel005 - Ringtoets.prfl) (revision 59c2ee32cb47c49461cf11d5aea1d78f3c230127) @@ -6,7 +6,10 @@ DAM 0 DAMHOOGTE 0.5 -VOORLAND 0 +VOORLAND 3 +-150.000 -9.000 1.000 +-100.000 -6.000 1.000 +-18.000 -6.000 1.000 DAMWAND 0 KRUINHOOGTE 6