Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileLocationReader.cs =================================================================== diff -u -r5bf1ff8f68f3b19d538edfe0550c39fc691a924b -r510c63c00d760a8370787bd20341dbb58fa40655 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileLocationReader.cs (.../DikeProfileLocationReader.cs) (revision 5bf1ff8f68f3b19d538edfe0550c39fc691a924b) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileLocationReader.cs (.../DikeProfileLocationReader.cs) (revision 510c63c00d760a8370787bd20341dbb58fa40655) @@ -84,7 +84,8 @@ /// /// Retrieve a based on the next point feature in the shapefile. /// - /// + /// Thrown when either: + /// /// The shapefile misses a value for a required attribute. /// The shapefile has an attribute whose type is incorrect. /// @@ -106,7 +107,7 @@ } catch (ArgumentException exception) { - throw new CriticalFileReadException(exception.Message); + throw new LineParseException(exception.Message); } } @@ -141,7 +142,7 @@ var attributeX0Value = attributes[offsetAttributeName] as double?; if (attributeX0Value == null) { - throw new CriticalFileReadException(GrasCoverErosionInwardsIoResources.DikeProfileLocationReader_GetDikeProfileLocations_Invalid_X0); + throw new LineParseException(GrasCoverErosionInwardsIoResources.DikeProfileLocationReader_GetDikeProfileLocations_Invalid_X0); } return attributeX0Value.Value; } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.Designer.cs =================================================================== diff -u -rf0a2ae314486dea1a00bcb462399ae4a4dd7e2dc -r510c63c00d760a8370787bd20341dbb58fa40655 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision f0a2ae314486dea1a00bcb462399ae4a4dd7e2dc) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 510c63c00d760a8370787bd20341dbb58fa40655) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -474,7 +474,7 @@ } /// - /// Looks up a localized string similar to Het bestand heeft een attribuut 'X0' zonder geldige waarde, welke vereist is om de locaties van de dijkprofielen in te lezen.. + /// Looks up a localized string similar to Het dijkprofiel heeft geen geldige waarde voor attribuut 'X0'.. /// internal static string DikeProfileLocationReader_GetDikeProfileLocations_Invalid_X0 { get { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.resx =================================================================== diff -u -rf0a2ae314486dea1a00bcb462399ae4a4dd7e2dc -r510c63c00d760a8370787bd20341dbb58fa40655 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.resx (.../Resources.resx) (revision f0a2ae314486dea1a00bcb462399ae4a4dd7e2dc) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Properties/Resources.resx (.../Resources.resx) (revision 510c63c00d760a8370787bd20341dbb58fa40655) @@ -130,7 +130,7 @@ Fout bij het aanmaken van een dijk profiel locatie: X0 is ongeldig. - Het bestand heeft een attribuut 'X0' zonder geldige waarde, welke vereist is om de locaties van de dijkprofielen in te lezen. + Het dijkprofiel heeft geen geldige waarde voor attribuut 'X0'. De ingelezen dam-type waarde ({0}) moet binnen het bereik [0, 3] vallen. Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/FileImporter/DikeProfilesImporter.cs =================================================================== diff -u -r92922f3d6dfe9d92031489fd3ef261dad5bb2c61 -r510c63c00d760a8370787bd20341dbb58fa40655 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/FileImporter/DikeProfilesImporter.cs (.../DikeProfilesImporter.cs) (revision 92922f3d6dfe9d92031489fd3ef261dad5bb2c61) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/FileImporter/DikeProfilesImporter.cs (.../DikeProfilesImporter.cs) (revision 510c63c00d760a8370787bd20341dbb58fa40655) @@ -174,6 +174,14 @@ NotifyProgress(Resources.DikeProfilesImporter_GetDikeProfileLocationReadResult_reading_dikeprofilelocation, i + 1, totalNumberOfSteps); AddNextDikeProfileLocation(dikeProfileLocationReader, referenceLine, dikeProfileLocations); } + catch (LineParseException exception) + { + var message = string.Format( + Resources.DikeProfilesImporter_GetDikeProfileLocationReadResult_Error_reading_DikeProfile_LineNumber_0_Error_1_The_DikeProfile_is_skipped, + i + 1, + exception.Message); + log.Warn(message); + } catch (CriticalFileReadException exception) { log.Error(exception.Message); @@ -192,7 +200,7 @@ /// Reader reading s for a shapefile. /// The reference line. /// Collection of s to which a new is to be added. - /// + /// /// The shapefile misses a value for a required attribute. /// The shapefile has an attribute whose type is incorrect. /// @@ -218,7 +226,6 @@ int totalNumberOfSteps = prflFilePaths.Length; var dikeProfileData = new Collection(); - Dictionary> duplicates = new Dictionary>(); var dikeProfileDataReader = new DikeProfileDataReader(); for (int i = 0; i < totalNumberOfSteps; i++) @@ -243,7 +250,7 @@ if (dikeProfileData.Any(d => d.Id.Equals(data.Id))) { - UpdateDuplicates(duplicates, data, prflFilePath); + LogDuplicate(data, prflFilePath); } else { @@ -254,52 +261,24 @@ catch (CriticalFileReadException exception) { log.Error(exception.Message); - return new ReadResult(true); } } - LogDuplicateDikeProfileData(duplicates); - return new ReadResult(false) { ImportedItems = dikeProfileData }; } - private static void UpdateDuplicates(Dictionary> duplicates, DikeProfileData data, string prflFilePath) + private void LogDuplicate(DikeProfileData data, string prflFilePath) { - if (!duplicates.ContainsKey(data.Id)) - { - duplicates.Add(data.Id, new List()); - } - duplicates[data.Id].Add(prflFilePath); + var message = string.Format( + Resources.DikeProfilesImporter_LogDuplicateDikeProfileData_Multiple_DikeProfileData_found_for_DikeProfile_0_File_1_skipped, + data.Id, + prflFilePath); + log.Error(message); } - private void LogDuplicateDikeProfileData(Dictionary> duplicates) - { - foreach (KeyValuePair> keyValuePair in duplicates) - { - StringBuilder builder = new StringBuilder( - string.Format(Resources.DikeProfilesImporter_LogDuplicateDikeProfileData_dikeprofiledata_file_with_id_0_used_files_1_are_skipped, - keyValuePair.Key, keyValuePair.Value.Count)); - - foreach (string filePath in keyValuePair.Value) - { - if (BuilderHasCapacityForFilePath(builder, filePath)) - { - builder.AppendLine(filePath); - } - } - string message = builder.ToString(); - log.Error(message); - } - } - - private static bool BuilderHasCapacityForFilePath(StringBuilder builder, string filePath) - { - return builder.Length + filePath.Length + Environment.NewLine.Length < builder.MaxCapacity; - } - private IEnumerable CreateDikeProfiles(ICollection dikeProfileLocationCollection, ICollection dikeProfileDataCollection) { List dikeProfiles = new List(); Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -rb2f462bcefa392f711e0e9ca259e2dceba5de633 -r510c63c00d760a8370787bd20341dbb58fa40655 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b2f462bcefa392f711e0e9ca259e2dceba5de633) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 510c63c00d760a8370787bd20341dbb58fa40655) @@ -90,6 +90,16 @@ } /// + /// Looks up a localized string similar to Fout bij het lezen van dijkprofiel op regel {0}. {1} Dit dijkprofiel wordt overgeslagen.. + /// + internal static string DikeProfilesImporter_GetDikeProfileLocationReadResult_Error_reading_DikeProfile_LineNumber_0_Error_1_The_DikeProfile_is_skipped { + get { + return ResourceManager.GetString("DikeProfilesImporter_GetDikeProfileLocationReadResult_Error_reading_DikeProfile_L" + + "ineNumber_0_Error_1_The_DikeProfile_is_skipped", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Inlezen van dijkprofiel locatie.. /// internal static string DikeProfilesImporter_GetDikeProfileLocationReadResult_reading_dikeprofilelocation { @@ -128,12 +138,12 @@ } /// - /// Looks up a localized string similar to Alleen het eerste dijkprofiel data bestand met Id {0} wordt gebruikt. De {1} overgeslagen bestanden zijn:. + /// Looks up a localized string similar to Meerdere dijkprofieldata definities gevonden voor dijkprofiel '{0}'. Bestand '{1}' wordt overgeslagen.. /// - internal static string DikeProfilesImporter_LogDuplicateDikeProfileData_dikeprofiledata_file_with_id_0_used_files_1_are_skipped { + internal static string DikeProfilesImporter_LogDuplicateDikeProfileData_Multiple_DikeProfileData_found_for_DikeProfile_0_File_1_skipped { get { - return ResourceManager.GetString("DikeProfilesImporter_LogDuplicateDikeProfileData_dikeprofiledata_file_with_id_0_u" + - "sed_files_1_are_skipped", resourceCulture); + return ResourceManager.GetString("DikeProfilesImporter_LogDuplicateDikeProfileData_Multiple_DikeProfileData_found_f" + + "or_DikeProfile_0_File_1_skipped", resourceCulture); } } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.resx =================================================================== diff -u -rb2f462bcefa392f711e0e9ca259e2dceba5de633 -r510c63c00d760a8370787bd20341dbb58fa40655 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.resx (.../Resources.resx) (revision b2f462bcefa392f711e0e9ca259e2dceba5de633) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 510c63c00d760a8370787bd20341dbb58fa40655) @@ -157,8 +157,8 @@ Voorland en dijkprofiel data specificeert een damwand waarde ongelijk aan 0. Bestand wordt overgeslagen: {0} - - Alleen het eerste dijkprofiel data bestand met Id {0} wordt gebruikt. De {1} overgeslagen bestanden zijn: + + Meerdere dijkprofieldata definities gevonden voor dijkprofiel '{0}'. Bestand '{1}' wordt overgeslagen. Kan geen voorland en dijkprofiel data vinden voor dijkprofiel locatie met Id: {0} @@ -172,4 +172,7 @@ Inlezen van voorland en dijkprofiel data. + + Fout bij het lezen van dijkprofiel op regel {0}. {1} Dit dijkprofiel wordt overgeslagen. + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs =================================================================== diff -u -r68588fbca4cc848bf72e39ec16940ce96c596bde -r510c63c00d760a8370787bd20341dbb58fa40655 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs (.../DikeProfileLocationReaderTest.cs) (revision 68588fbca4cc848bf72e39ec16940ce96c596bde) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs (.../DikeProfileLocationReaderTest.cs) (revision 510c63c00d760a8370787bd20341dbb58fa40655) @@ -195,7 +195,7 @@ // Assert var expectedMessage = "De locatie parameter 'Id' heeft geen waarde."; - string message = Assert.Throws(call).Message; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } } @@ -213,8 +213,8 @@ TestDelegate call = () => reader.GetNextDikeProfileLocation(); // Assert - var expectedMessage = "Het bestand heeft een attribuut 'X0' zonder geldige waarde, welke vereist is om de locaties van de dijkprofielen in te lezen."; - string message = Assert.Throws(call).Message; + var expectedMessage = "Het dijkprofiel heeft geen geldige waarde voor attribuut 'X0'."; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } } @@ -235,7 +235,7 @@ // Assert var expectedMessage = "De locatie parameter 'Id' mag uitsluitend uit letters en cijfers bestaan."; - string message = Assert.Throws(call).Message; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporter/DikeProfilesImporterTest.cs =================================================================== diff -u -r92922f3d6dfe9d92031489fd3ef261dad5bb2c61 -r510c63c00d760a8370787bd20341dbb58fa40655 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporter/DikeProfilesImporterTest.cs (.../DikeProfilesImporterTest.cs) (revision 92922f3d6dfe9d92031489fd3ef261dad5bb2c61) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporter/DikeProfilesImporterTest.cs (.../DikeProfilesImporterTest.cs) (revision 510c63c00d760a8370787bd20341dbb58fa40655) @@ -304,7 +304,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - assessmentSection.ReferenceLine = new ReferenceLine(); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var targetContext = new DikeProfilesContext(failureMechanism.DikeProfiles, assessmentSection); @@ -319,10 +319,10 @@ TestHelper.AssertLogMessages(call, messages => { string[] messageArray = messages.ToArray(); - string message = "De locatie parameter 'Id' mag uitsluitend uit letters en cijfers bestaan."; + string message = "Fout bij het lezen van dijkprofiel op regel 1. De locatie parameter 'Id' mag uitsluitend uit letters en cijfers bestaan. Dit dijkprofiel wordt overgeslagen."; Assert.AreEqual(message, messageArray[0]); }); - Assert.IsFalse(importResult); + Assert.IsTrue(importResult); mockRepository.VerifyAll(); } @@ -336,7 +336,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - assessmentSection.ReferenceLine = new ReferenceLine(); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var targetContext = new DikeProfilesContext(failureMechanism.DikeProfiles, assessmentSection); @@ -351,10 +351,14 @@ TestHelper.AssertLogMessages(call, messages => { string[] messageArray = messages.ToArray(); - string message = "De locatie parameter 'Id' heeft geen waarde."; - Assert.AreEqual(message, messageArray[0]); + string message1 = "Fout bij het lezen van dijkprofiel op regel 1. De locatie parameter 'Id' heeft geen waarde. Dit dijkprofiel wordt overgeslagen."; + string message2 = "Fout bij het lezen van dijkprofiel op regel 2. De locatie parameter 'Id' heeft geen waarde. Dit dijkprofiel wordt overgeslagen."; + string message3 = "Fout bij het lezen van dijkprofiel op regel 4. De locatie parameter 'Id' heeft geen waarde. Dit dijkprofiel wordt overgeslagen."; + Assert.AreEqual(message1, messageArray[0]); + Assert.AreEqual(message2, messageArray[1]); + Assert.AreEqual(message3, messageArray[2]); }); - Assert.IsFalse(importResult); + Assert.IsTrue(importResult); mockRepository.VerifyAll(); } @@ -368,16 +372,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - var referencePoints = new List - { - new Point2D(131223.2, 548393.4), - new Point2D(133854.3, 545323.1), - new Point2D(135561.0, 541920.3), - new Point2D(136432.1, 538235.2), - new Point2D(136039.4, 533920.2) - }; - assessmentSection.ReferenceLine = new ReferenceLine(); - assessmentSection.ReferenceLine.SetGeometry(referencePoints); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var targetContext = new DikeProfilesContext(failureMechanism.DikeProfiles, assessmentSection); @@ -424,10 +419,10 @@ TestHelper.AssertLogMessages(call, messages => { string[] messageArray = messages.ToArray(); - string message = "Het bestand heeft een attribuut 'X0' zonder geldige waarde, welke vereist is om de locaties van de dijkprofielen in te lezen."; + string message = "Fout bij het lezen van dijkprofiel op regel 1. Het dijkprofiel heeft geen geldige waarde voor attribuut 'X0'. Dit dijkprofiel wordt overgeslagen."; Assert.AreEqual(message, messageArray[0]); }); - Assert.IsFalse(importResult); + Assert.IsTrue(importResult); mockRepository.VerifyAll(); } @@ -558,16 +553,7 @@ var observer = mockRepository.StrictMock(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - var referencePoints = new List - { - new Point2D(131223.2, 548393.4), - new Point2D(133854.3, 545323.1), - new Point2D(135561.0, 541920.3), - new Point2D(136432.1, 538235.2), - new Point2D(136039.4, 533920.2) - }; - assessmentSection.ReferenceLine = new ReferenceLine(); - assessmentSection.ReferenceLine.SetGeometry(referencePoints); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var progressChangeNotifications = new List(); @@ -614,16 +600,7 @@ var observer = mockRepository.StrictMock(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - var referencePoints = new List - { - new Point2D(131223.2, 548393.4), - new Point2D(133854.3, 545323.1), - new Point2D(135561.0, 541920.3), - new Point2D(136432.1, 538235.2), - new Point2D(136039.4, 533920.2) - }; - assessmentSection.ReferenceLine = new ReferenceLine(); - assessmentSection.ReferenceLine.SetGeometry(referencePoints); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var progressChangeNotifications = new List(); @@ -660,16 +637,7 @@ var observer = mockRepository.StrictMock(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - var referencePoints = new List - { - new Point2D(131223.2, 548393.4), - new Point2D(133854.3, 545323.1), - new Point2D(135561.0, 541920.3), - new Point2D(136432.1, 538235.2), - new Point2D(136039.4, 533920.2) - }; - assessmentSection.ReferenceLine = new ReferenceLine(); - assessmentSection.ReferenceLine.SetGeometry(referencePoints); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var progressChangeNotifications = new List(); @@ -716,16 +684,7 @@ var observer = mockRepository.StrictMock(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - var referencePoints = new List - { - new Point2D(131223.2, 548393.4), - new Point2D(133854.3, 545323.1), - new Point2D(135561.0, 541920.3), - new Point2D(136432.1, 538235.2), - new Point2D(136039.4, 533920.2) - }; - assessmentSection.ReferenceLine = new ReferenceLine(); - assessmentSection.ReferenceLine.SetGeometry(referencePoints); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var progressChangeNotifications = new List(); @@ -750,7 +709,7 @@ Assert.IsTrue(found); }; TestHelper.AssertLogMessages(call, asserts); - Assert.IsFalse(importResult); + Assert.IsTrue(importResult); mockRepository.VerifyAll(); // 'observer' should not be notified } @@ -763,16 +722,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - var referencePoints = new List - { - new Point2D(131223.2, 548393.4), - new Point2D(133854.3, 545323.1), - new Point2D(135561.0, 541920.3), - new Point2D(136432.1, 538235.2), - new Point2D(136039.4, 533920.2) - }; - assessmentSection.ReferenceLine = new ReferenceLine(); - assessmentSection.ReferenceLine.SetGeometry(referencePoints); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); DikeProfilesImporter dikeProfilesImporter = new DikeProfilesImporter(); @@ -803,16 +753,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - var referencePoints = new List - { - new Point2D(131223.2, 548393.4), - new Point2D(133854.3, 545323.1), - new Point2D(135561.0, 541920.3), - new Point2D(136432.1, 538235.2), - new Point2D(136039.4, 533920.2) - }; - assessmentSection.ReferenceLine = new ReferenceLine(); - assessmentSection.ReferenceLine.SetGeometry(referencePoints); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var targetContext = new DikeProfilesContext(failureMechanism.DikeProfiles, assessmentSection); @@ -861,7 +802,7 @@ // Assert Action> asserts = (messages) => { - bool found = messages.Any(message => message.StartsWith("Alleen het eerste dijkprofiel data bestand met Id profiel001 wordt gebruikt. De 1 overgeslagen bestanden zijn:")); + bool found = messages.Any(message => message.StartsWith("Meerdere dijkprofieldata definities gevonden voor dijkprofiel 'profiel001'. Bestand 'D:\\repos\\WettelijkToetsInstrumentarium\\Ringtoets\\GrassCoverErosionInwards\\test\\Ringtoets.GrassCoverErosionInwards.IO.Test\\test-data\\DikeProfiles\\TwoPrflWithSameId\\profiel001_2.prfl' wordt overgeslagen.")); Assert.IsTrue(found); }; TestHelper.AssertLogMessages(call, asserts); @@ -880,13 +821,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var assessmentSection = mockRepository.Stub(); - var referencePoints = new List - { - new Point2D(130074.3, 543717.4), - new Point2D(130084.3, 543727.4) - }; - assessmentSection.ReferenceLine = new ReferenceLine(); - assessmentSection.ReferenceLine.SetGeometry(referencePoints); + assessmentSection.ReferenceLine = CreateMatchingReferenceLine(); mockRepository.ReplayAll(); var targetContext = new DikeProfilesContext(failureMechanism.DikeProfiles, assessmentSection); @@ -943,10 +878,23 @@ Assert.IsTrue(found); }; TestHelper.AssertLogMessages(call, asserts); - Assert.IsFalse(importResult); + Assert.IsTrue(importResult); mockRepository.VerifyAll(); // 'observer' should not be notified } + private ReferenceLine CreateMatchingReferenceLine() + { + var referenceLine = new ReferenceLine(); + referenceLine.SetGeometry(new[] { + new Point2D(131223.2, 548393.4), + new Point2D(133854.3, 545323.1), + new Point2D(135561.0, 541920.3), + new Point2D(136432.1, 538235.2), + new Point2D(136039.4, 533920.2) + }); + return referenceLine; + } + private static void ValidateProgressMessages(List expectedProgressMessages, List progressChangeNotifications, DikeProfilesContext targetContext) { Assert.AreEqual(expectedProgressMessages.Count, progressChangeNotifications.Count);