Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs =================================================================== diff -u -r07a6e1a6e626e79c57c8a4eb7716b5bb13981ae8 -re68cf27e96c240c8da274e299080f1a79f605122 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs (.../PipingSurfaceLinesCsvImporter.cs) (revision 07a6e1a6e626e79c57c8a4eb7716b5bb13981ae8) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs (.../PipingSurfaceLinesCsvImporter.cs) (revision e68cf27e96c240c8da274e299080f1a79f605122) @@ -163,6 +163,7 @@ private void AddImportedDataToModel(RingtoetsPipingSurfaceLinesContext target, ICollection readSurfaceLines, ICollection readCharacteristicPointsLocations) { NotifyProgress(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_Adding_imported_data_to_model, 0, readSurfaceLines.Count); + log.Info(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines); var targetCollection = target.FailureMechanism.SurfaceLines; List readCharacteristicPointsLocationNames = readCharacteristicPointsLocations.Select(cpl => cpl.Name).ToList(); @@ -200,6 +201,7 @@ log.WarnFormat(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Characteristic_points_found_for_unknown_SurfaceLine_0_, name); } + log.Info(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines); } private ReferenceLineIntersectionResult CheckReferenceLineInterSections(RingtoetsPipingSurfaceLine readSurfaceLine, ReferenceLine referenceLine) @@ -315,7 +317,15 @@ return new ReadResult(true); } - return ReadPipingSurfaceLines(path, reader); + log.InfoFormat(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + path); + + ReadResult readPipingSurfaceLines = ReadPipingSurfaceLines(path, reader); + + log.InfoFormat(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + path); + + return readPipingSurfaceLines; } } @@ -464,9 +474,15 @@ return new ReadResult(true); } - log.InfoFormat(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, + log.InfoFormat(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, path); - return ReadCharacteristicPoints(path, reader); + + ReadResult readCharacteristicPoints = ReadCharacteristicPoints(path, reader); + + log.InfoFormat(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + path); + + return readCharacteristicPoints; } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -r5b575c7019f5ec9d0db2784fda5cb5c7b4df9a90 -re68cf27e96c240c8da274e299080f1a79f605122 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5b575c7019f5ec9d0db2784fda5cb5c7b4df9a90) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e68cf27e96c240c8da274e299080f1a79f605122) @@ -236,6 +236,16 @@ } /// + /// Looks up a localized string similar to Klaar met plaatsen van profielschematisaties in het faalmechanisme.. + /// + public static string PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines { + get { + return ResourceManager.GetString("PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_line" + + "s", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Er konden geen karakteristieke punten gevonden worden voor locatie '{0}'.. /// public static string PipingSurfaceLinesCsvImporter_AddImportedDataToModel_No_characteristic_points_for_SurfaceLine_0_ { @@ -246,6 +256,15 @@ } /// + /// Looks up a localized string similar to Begonnen met plaatsen van profielschematiseringen in het faalmechanisme.. + /// + public static string PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines { + get { + return ResourceManager.GetString("PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Geïmporteerde data toevoegen aan faalmechanisme. /// public static string PipingSurfaceLinesCsvImporter_Adding_imported_data_to_model { @@ -360,6 +379,16 @@ } /// + /// Looks up a localized string similar to Klaar met het inlezen van karakteristieke punten uit bestand '{0}'.. + /// + public static string PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_ { + get { + return ResourceManager.GetString("PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_character" + + "istic_points_from_File_0_", resourceCulture); + } + } + + /// /// Looks up a localized string similar to {0} ///Deze locatie met karakteristieke punten wordt overgeslagen.. /// @@ -373,10 +402,10 @@ /// /// Looks up a localized string similar to Begonnen met het inlezen van karakteristieke punten uit bestand '{0}'.. /// - public static string PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_ { + public static string PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_ { get { return ResourceManager.GetString("PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characterist" + - "ic_points_from_file_0_", resourceCulture); + "ic_points_from_File_0_", resourceCulture); } } @@ -410,6 +439,26 @@ } /// + /// Looks up a localized string similar to Klaar met het inlezen van profielschematisaties uit bestand '{0}'.. + /// + public static string PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_ { + get { + return ResourceManager.GetString("PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_fro" + + "m_File_0_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begonnen met het inlezen van profielschematisaties uit bestand '{0}'.. + /// + public static string PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_ { + get { + return ResourceManager.GetString("PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_F" + + "ile_0_", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Profielschematisatie {0} bevat aaneengesloten dubbele geometrie punten, welke zijn genegeerd.. /// public static string PipingSurfaceLinesCsvImporter_SurfaceLine_0_has_multiple_duplicate_geometry_points_and_is_ignored { Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx =================================================================== diff -u -r5b575c7019f5ec9d0db2784fda5cb5c7b4df9a90 -re68cf27e96c240c8da274e299080f1a79f605122 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 5b575c7019f5ec9d0db2784fda5cb5c7b4df9a90) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/Properties/Resources.resx (.../Resources.resx) (revision e68cf27e96c240c8da274e299080f1a79f605122) @@ -179,7 +179,7 @@ Er konden geen karakteristieke punten gevonden worden voor locatie '{0}'. - + Begonnen met het inlezen van karakteristieke punten uit bestand '{0}'. @@ -236,4 +236,19 @@ Controleren van ondergrondprofielen. + + Klaar met plaatsen van profielschematisaties in het faalmechanisme. + + + Begonnen met plaatsen van profielschematiseringen in het faalmechanisme. + + + Begonnen met het inlezen van profielschematisaties uit bestand '{0}'. + + + Klaar met het inlezen van profielschematisaties uit bestand '{0}'. + + + Klaar met het inlezen van karakteristieke punten uit bestand '{0}'. + \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs =================================================================== diff -u -r5b575c7019f5ec9d0db2784fda5cb5c7b4df9a90 -re68cf27e96c240c8da274e299080f1a79f605122 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs (.../PipingSurfaceLinesCsvImporterTest.cs) (revision 5b575c7019f5ec9d0db2784fda5cb5c7b4df9a90) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs (.../PipingSurfaceLinesCsvImporterTest.cs) (revision e68cf27e96c240c8da274e299080f1a79f605122) @@ -19,7 +19,7 @@ using PipingIOResources = Ringtoets.Piping.IO.Properties.Resources; using PipingDataResources = Ringtoets.Piping.Data.Properties.Resources; using RingtoetsFormsResources = Ringtoets.Common.Forms.Properties.Resources; -using ApplicationResources = Ringtoets.Piping.Plugin.Properties.Resources; +using PipingPluginResources = Ringtoets.Piping.Plugin.Properties.Resources; using UtilsResources = Core.Common.Utils.Properties.Resources; namespace Ringtoets.Piping.Plugin.Test.FileImporter @@ -46,7 +46,7 @@ Assert.AreEqual(16, importer.Image.Width); Assert.AreEqual(16, importer.Image.Height); var expectedFileFilter = String.Format("{0} {1} (*.csv)|*.csv", - PipingFormsResources.PipingSurfaceLinesCollection_DisplayName, ApplicationResources.Csv_file_name); + PipingFormsResources.PipingSurfaceLinesCollection_DisplayName, PipingPluginResources.Csv_file_name); Assert.AreEqual(expectedFileFilter, importer.FileFilter); } @@ -157,23 +157,23 @@ if (!progressStarted && callCount == 0) { progressStarted = true; - Assert.AreEqual(ApplicationResources.PipingSurfaceLinesCsvImporter_Reading_surface_line_file, currentStepName); + Assert.AreEqual(PipingPluginResources.PipingSurfaceLinesCsvImporter_Reading_surface_line_file, currentStepName); return; } if (!progressCharacteristicPointsStarted && callCount == expectedNumberOfSurfaceLines + 1) { progressCharacteristicPointsStarted = true; - Assert.AreEqual(ApplicationResources.PipingSurfaceLinesCsvImporter_Reading_characteristic_points_file, currentStepName); + Assert.AreEqual(PipingPluginResources.PipingSurfaceLinesCsvImporter_Reading_characteristic_points_file, currentStepName); return; } if (callCount <= expectedNumberOfSurfaceLines) { - Assert.AreEqual(String.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Read_PipingSurfaceLines_0_, twovalidsurfacelinesCsv), currentStepName); + Assert.AreEqual(String.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Read_PipingSurfaceLines_0_, twovalidsurfacelinesCsv), currentStepName); } else if (callCount <= expectedNumberOfSurfaceLines + 1 + expectedNumberOfSurfaceLines) { - Assert.AreEqual(ApplicationResources.PipingSurfaceLinesCsvImporter_Adding_imported_data_to_model, currentStepName); + Assert.AreEqual(PipingPluginResources.PipingSurfaceLinesCsvImporter_Adding_imported_data_to_model, currentStepName); } else { @@ -253,12 +253,18 @@ // Assert var mesages = new[] { + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + validFilePath), "Profielschematisatie Rotterdam1 bevat aaneengesloten dubbele geometrie punten, welke zijn genegeerd.", - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, - Path.Combine(ioTestDataPath, "ValidSurfaceLine_HasConsecutiveDuplicatePoints.krp.csv")) + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + validFilePath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, + Path.Combine(ioTestDataPath, "ValidSurfaceLine_HasConsecutiveDuplicatePoints.krp.csv")), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, mesages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, mesages, 6); Assert.IsTrue(importResult); var importTargetArray = context.FailureMechanism.SurfaceLines.ToArray(); Assert.AreEqual(1, importTargetArray.Length); @@ -311,7 +317,7 @@ Action call = () => importResult = importer.Import(context, validFilePath); // Assert - TestHelper.AssertLogMessageIsGenerated(call, ApplicationResources.PipingSurfaceLinesCsvImporter_Import_Import_cancelled, 1); + TestHelper.AssertLogMessageIsGenerated(call, PipingPluginResources.PipingSurfaceLinesCsvImporter_Import_Import_cancelled, 3); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines); @@ -391,7 +397,7 @@ // Assert var internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath).Build(String.Format(UtilsResources.Error_Path_cannot_contain_Characters_0_, String.Join(", ", Path.GetInvalidFileNameChars()))); - var expectedLogMessage = string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, + var expectedLogMessage = string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, internalErrorMessage); TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1); Assert.IsFalse(importResult); @@ -425,9 +431,16 @@ // Assert var internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath).Build(UtilsResources.Error_File_does_not_exist); - var expectedLogMessage = string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, - internalErrorMessage); - TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1); + var expectedLogMessages = new[] + { + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, + internalErrorMessage), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + corruptPath), + }; + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 3); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines, "No items should be added to collection when import is aborted."); @@ -461,9 +474,16 @@ var internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath) .WithLocation("op regel 1") .Build(UtilsResources.Error_File_empty); - var expectedLogMessage = string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, - internalErrorMessage); - TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1); + var expectedLogMessages = new[] + { + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, + internalErrorMessage) + }; + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 3); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines, "No items should be added to collection when import is aborted."); @@ -497,9 +517,16 @@ var internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath) .WithLocation("op regel 1") .Build(PipingIOResources.PipingSurfaceLinesCsvReader_File_invalid_header); - var expectedLogMessage = string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, - internalErrorMessage); - TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1); + var expectedLogMessages = new[] + { + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, + internalErrorMessage), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + corruptPath) + }; + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 3); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines, "No items should be added to collection when import is aborted."); @@ -540,9 +567,16 @@ // Assert var internalErrorMessage = new FileReaderErrorMessageBuilder(copyTargetPath).Build(UtilsResources.Error_File_does_not_exist); - var expectedLogMessage = string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, - internalErrorMessage); - TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1); + var expectedLogMessages = new[] + { + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + copyTargetPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + copyTargetPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, + internalErrorMessage) + }; + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 3); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines, "No items should be added to collection when import is aborted."); @@ -591,14 +625,20 @@ Action call = () => importResult = importer.Import(context, corruptPath); // Assert - var duplicateDefinitionMessage = string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Duplicate_definitions_for_same_location_0_, "Rotterdam1"); + var duplicateDefinitionMessage = string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Duplicate_definitions_for_same_location_0_, "Rotterdam1"); var expectedLogMessages = new[] { + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + corruptPath), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, duplicateDefinitionMessage, - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, expectedCharacteristicPointsFile) + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, expectedCharacteristicPointsFile), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 6); Assert.IsTrue(importResult); Assert.AreEqual(1, context.FailureMechanism.SurfaceLines.Count, @@ -646,14 +686,21 @@ .WithLocation("op regel 3") .WithSubject("profielschematisatie 'InvalidRow'") .Build(PipingIOResources.Error_SurfaceLine_has_not_double); + string characteristicPointsFilePath = Path.Combine(ioTestDataPath, "TwoValidAndOneInvalidNumberRowSurfaceLines.krp.csv"); var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadPipingSurfaceLines_ParseErrorMessage_0_SurfaceLine_skipped, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadPipingSurfaceLines_ParseErrorMessage_0_SurfaceLine_skipped, internalErrorMessage), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, - Path.Combine(ioTestDataPath, "TwoValidAndOneInvalidNumberRowSurfaceLines.krp.csv")) + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, + characteristicPointsFilePath), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 6); Assert.IsTrue(importResult); Assert.AreEqual(2, context.FailureMechanism.SurfaceLines.Count, @@ -709,12 +756,18 @@ .Build(PipingIOResources.PipingSurfaceLinesCsvReader_ReadLine_SurfaceLine_has_reclining_geometry); var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadPipingSurfaceLines_ParseErrorMessage_0_SurfaceLine_skipped, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + path), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + path), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadPipingSurfaceLines_ParseErrorMessage_0_SurfaceLine_skipped, internalErrorMessage), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, - Path.Combine(ioTestDataPath, "InvalidRow_DuplicatePointsCausingRecline.krp.csv")) + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, + Path.Combine(ioTestDataPath, "InvalidRow_DuplicatePointsCausingRecline.krp.csv")), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 6); Assert.IsTrue(importResult); var importTargetArray = context.FailureMechanism.SurfaceLines.ToArray(); Assert.AreEqual(0, importTargetArray.Length); @@ -758,12 +811,18 @@ .Build(PipingIOResources.PipingSurfaceLinesCsvReader_ReadLine_SurfaceLine_has_zero_length); var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadPipingSurfaceLines_ParseErrorMessage_0_SurfaceLine_skipped, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + path), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + path), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadPipingSurfaceLines_ParseErrorMessage_0_SurfaceLine_skipped, internalErrorMessage), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, - Path.Combine(ioTestDataPath, "InvalidRow_DuplicatePointsCausingZeroLength.krp.csv")) + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, + Path.Combine(ioTestDataPath, "InvalidRow_DuplicatePointsCausingZeroLength.krp.csv")), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 6); Assert.IsTrue(importResult); var importTargetArray = context.FailureMechanism.SurfaceLines.ToArray(); Assert.AreEqual(0, importTargetArray.Length); @@ -803,7 +862,7 @@ Action call = () => importResult = importer.Import(context, validFilePath); // Assert - TestHelper.AssertLogMessageIsGenerated(call, ApplicationResources.PipingSurfaceLinesCsvImporter_Import_Import_cancelled, 1); + TestHelper.AssertLogMessageIsGenerated(call, PipingPluginResources.PipingSurfaceLinesCsvImporter_Import_Import_cancelled, 3); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines); @@ -815,7 +874,7 @@ { // Setup var fileName = "TwoValidSurfaceLines"; - string surfaceLineFile = Path.Combine(ioTestDataPath, string.Format(surfaceLineFormat, fileName)); + string surfaceLinesFile = Path.Combine(ioTestDataPath, string.Format(surfaceLineFormat, fileName)); string nonExistingCharacteristicFile = Path.Combine(ioTestDataPath, string.Format(krpFormat, fileName)); var mocks = new MockRepository(); @@ -841,16 +900,16 @@ var importResult = true; // Precondition - Assert.IsTrue(File.Exists(surfaceLineFile)); + Assert.IsTrue(File.Exists(surfaceLinesFile)); Assert.IsFalse(File.Exists(nonExistingCharacteristicFile)); // Call - Action call = () => importResult = importer.Import(context, surfaceLineFile); + Action call = () => importResult = importer.Import(context, surfaceLinesFile); // Assert - var expectedLogMessage = string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, + var expectedLogMessage = string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Import_No_characteristic_points_file_for_surface_line_file_expecting_file_0_, nonExistingCharacteristicFile); - TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1); + TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 5); Assert.IsTrue(importResult); Assert.AreEqual(2, context.FailureMechanism.SurfaceLines.Count); mocks.VerifyAll(); // Expect no calls on 'observer' @@ -861,7 +920,7 @@ { // Setup const string fileName = "TwoValidSurfaceLines_EmptyCharacteristicPoints"; - string surfaceLineFile = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); + string surfaceLinesFile = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); string corruptPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(krpFormat, fileName)); var mocks = new MockRepository(); @@ -879,7 +938,7 @@ var importResult = true; // Call - Action call = () => importResult = importer.Import(context, surfaceLineFile); + Action call = () => importResult = importer.Import(context, surfaceLinesFile); // Assert var internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath) @@ -888,12 +947,18 @@ var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + surfaceLinesFile), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + surfaceLinesFile), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, corruptPath), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, internalErrorMessage) }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 5); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines, "No items should be added to collection when import is aborted."); @@ -905,7 +970,7 @@ { // Setup const string fileName = "TwoValidSurfaceLines_InvalidHeaderCharacteristicPoints"; - string surfaceLineFile = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); + string surfaceLinesFile = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); string corruptPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(krpFormat, fileName)); var mocks = new MockRepository(); @@ -923,7 +988,7 @@ var importResult = true; // Call - Action call = () => importResult = importer.Import(context, surfaceLineFile); + Action call = () => importResult = importer.Import(context, surfaceLinesFile); // Assert var internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath) @@ -932,13 +997,19 @@ var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + surfaceLinesFile), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + surfaceLinesFile), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, corruptPath), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, internalErrorMessage) }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 5); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines, "No items should be added to collection when import is aborted."); @@ -954,9 +1025,9 @@ var copyTargetPath = string.Format(surfaceLineFormat, target); var copyCharacteristicPointsTargetPath = string.Format(krpFormat, target); - string surfaceLines = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, source)); + string surfaceLinesPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, source)); string validFilePath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(krpFormat, source)); - File.Copy(surfaceLines, copyTargetPath); + File.Copy(surfaceLinesPath, copyTargetPath); File.Copy(validFilePath, copyCharacteristicPointsTargetPath); try @@ -975,7 +1046,7 @@ importer.ProgressChanged = (name, step, steps) => { // Delete the file being read by the import during the import itself: - if (name == string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Read_PipingCharacteristicPoints_0_, + if (name == string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Read_PipingCharacteristicPoints_0_, copyCharacteristicPointsTargetPath)) { File.Delete(copyCharacteristicPointsTargetPath); @@ -991,12 +1062,18 @@ var internalErrorMessage = new FileReaderErrorMessageBuilder(copyCharacteristicPointsTargetPath).Build(UtilsResources.Error_File_does_not_exist); var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + copyTargetPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + copyTargetPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, copyCharacteristicPointsTargetPath), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + copyCharacteristicPointsTargetPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, internalErrorMessage) }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 5); Assert.IsFalse(importResult); CollectionAssert.IsEmpty(context.FailureMechanism.SurfaceLines, "No items should be added to collection when import is aborted."); @@ -1022,7 +1099,7 @@ { // Setup const string fileName = "TwoValidSurfaceLines_DuplicateIdentifiersCharacteristicPoints"; - string surfaceLineFile = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); + string surfaceLinesFile = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); string corruptPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(krpFormat, fileName)); var mocks = new MockRepository(); @@ -1048,17 +1125,26 @@ var importResult = true; // Call - Action call = () => importResult = importer.Import(context, surfaceLineFile); + Action call = () => importResult = importer.Import(context, surfaceLinesFile); // Assert - var duplicateDefinitionMessage = string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Duplicate_definitions_for_same_characteristic_point_location_0_, + var duplicateDefinitionMessage = string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Duplicate_definitions_for_same_characteristic_point_location_0_, "Rotterdam1"); var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, corruptPath), - duplicateDefinitionMessage + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + surfaceLinesFile), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + surfaceLinesFile), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + corruptPath), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + duplicateDefinitionMessage, + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines, }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 7); Assert.IsTrue(importResult); Assert.AreEqual(2, context.FailureMechanism.SurfaceLines.Count, @@ -1074,7 +1160,7 @@ { // Setup const string fileName = "TwoValidSurfaceLines_WithOneInvalidCharacteristicPoints"; - string surfaceLineFile = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); + string surfaceLinesFile = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); string corruptPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(krpFormat, fileName)); var mocks = new MockRepository(); @@ -1102,7 +1188,7 @@ var importResult = false; // Call - Action call = () => importResult = importer.Import(context, surfaceLineFile); + Action call = () => importResult = importer.Import(context, surfaceLinesFile); // Assert var internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath) @@ -1111,14 +1197,22 @@ .Build(PipingIOResources.Error_CharacteristicPoint_has_not_double); var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + surfaceLinesFile), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + surfaceLinesFile), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, corruptPath), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_ParseErrorMessage_0_CharacteristicPoints_skipped, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_ParseErrorMessage_0_CharacteristicPoints_skipped, internalErrorMessage), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_No_characteristic_points_for_SurfaceLine_0_, - "Rotterdam1Invalid") + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_No_characteristic_points_for_SurfaceLine_0_, + "Rotterdam1Invalid"), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + corruptPath), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 3); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 8); Assert.IsTrue(importResult); Assert.AreEqual(2, context.FailureMechanism.SurfaceLines.Count, @@ -1146,7 +1240,7 @@ { // Setup const string fileName = "TwoValidSurfaceLines_WithOneCharacteristicPointsLocation"; - string surfaceLines = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); + string surfaceLinesPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); string corruptPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(krpFormat, fileName)); var mocks = new MockRepository(); @@ -1174,17 +1268,25 @@ var importResult = false; // Call - Action call = () => importResult = importer.Import(context, surfaceLines); + Action call = () => importResult = importer.Import(context, surfaceLinesPath); // Assert var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + surfaceLinesPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + surfaceLinesPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, corruptPath), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_No_characteristic_points_for_SurfaceLine_0_, - "Rotterdam1") + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_No_characteristic_points_for_SurfaceLine_0_, + "Rotterdam1"), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 7); Assert.IsTrue(importResult); Assert.AreEqual(2, context.FailureMechanism.SurfaceLines.Count, @@ -1212,7 +1314,7 @@ { // Setup const string fileName = "TwoValidSurfaceLines_WithThreeCharacteristicPointsLocations"; - string surfaceLines = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); + string surfaceLinesPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); string corruptPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(krpFormat, fileName)); var mocks = new MockRepository(); @@ -1240,17 +1342,25 @@ var importResult = false; // Call - Action call = () => importResult = importer.Import(context, surfaceLines); + Action call = () => importResult = importer.Import(context, surfaceLinesPath); // Assert var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + surfaceLinesPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + surfaceLinesPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, corruptPath), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Characteristic_points_found_for_unknown_SurfaceLine_0_, - "Extra") + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + corruptPath), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Characteristic_points_found_for_unknown_SurfaceLine_0_, + "Extra"), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 7); Assert.IsTrue(importResult); Assert.AreEqual(2, context.FailureMechanism.SurfaceLines.Count, @@ -1283,7 +1393,7 @@ public void Import_FileWithTwoValidLinesAndCharacteristicPointNotOnGeometry_LogInvalidPointDefinition(string fileName, string characteristicPointName) { // Setup - string surfaceLines = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); + string surfaceLinesPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(surfaceLineFormat, fileName)); string corruptPath = Path.Combine(pluginSurfaceLinesTestDataPath, string.Format(krpFormat, fileName)); var mocks = new MockRepository(); @@ -1311,21 +1421,29 @@ var importResult = false; // Call - Action call = () => importResult = importer.Import(context, surfaceLines); + Action call = () => importResult = importer.Import(context, surfaceLinesPath); // Assert var pointFormat = string.Format(PipingDataResources.RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_to_assign_as_characteristic_point_1_, new Point3D(0, 1, 2), characteristicPointName); var expectedLogMessages = new[] { - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_file_0_, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Start_reading_surface_lines_from_File_0_, + surfaceLinesPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadSurfaceLines_Finished_reading_surface_lines_from_File_0_, + surfaceLinesPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Start_reading_characteristic_points_from_File_0_, corruptPath), - string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_CharacteristicPoint_of_SurfaceLine_0_skipped_cause_1_, + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_ReadCharacteristicPoints_Finished_reading_characteristic_points_from_File_0_, + corruptPath), + string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CharacteristicPoint_of_SurfaceLine_0_skipped_cause_1_, "Rotterdam1Invalid", - pointFormat) + pointFormat), + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Start_adding_surface_lines, + PipingPluginResources.PipingSurfaceLinesCsvImporter_AddImportedDataToModel_Finished_adding_surface_lines }; - TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 7); Assert.IsTrue(importResult); Assert.AreEqual(2, context.FailureMechanism.SurfaceLines.Count, @@ -1389,27 +1507,27 @@ if (!progressStarted && callCount == 0) { progressStarted = true; - Assert.AreEqual(ApplicationResources.PipingSurfaceLinesCsvImporter_Reading_surface_line_file, currentStepName); + Assert.AreEqual(PipingPluginResources.PipingSurfaceLinesCsvImporter_Reading_surface_line_file, currentStepName); return; } if (!progressCharacteristicPointsStarted && callCount == expectedNumberOfSurfaceLines + 1) { progressCharacteristicPointsStarted = true; - Assert.AreEqual(ApplicationResources.PipingSurfaceLinesCsvImporter_Reading_characteristic_points_file, currentStepName); + Assert.AreEqual(PipingPluginResources.PipingSurfaceLinesCsvImporter_Reading_characteristic_points_file, currentStepName); return; } if (callCount <= expectedNumberOfSurfaceLines) { - Assert.AreEqual(string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Read_PipingSurfaceLines_0_, twovalidsurfacelinesCsv), currentStepName); + Assert.AreEqual(string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Read_PipingSurfaceLines_0_, twovalidsurfacelinesCsv), currentStepName); } else if (callCount <= expectedNumberOfSurfaceLines + expectedNumberOfCharacteristicPointsDefinitions + 1) { - Assert.AreEqual(string.Format(ApplicationResources.PipingSurfaceLinesCsvImporter_Read_PipingCharacteristicPoints_0_, twovalidsurfacelinesCharacteristicPointsCsv), currentStepName); + Assert.AreEqual(string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_Read_PipingCharacteristicPoints_0_, twovalidsurfacelinesCharacteristicPointsCsv), currentStepName); } else if (callCount <= expectedNumberOfSurfaceLines + expectedNumberOfCharacteristicPointsDefinitions + 2 + expectedNumberOfSurfaceLines) { - Assert.AreEqual(ApplicationResources.PipingSurfaceLinesCsvImporter_Adding_imported_data_to_model, currentStepName); + Assert.AreEqual(PipingPluginResources.PipingSurfaceLinesCsvImporter_Adding_imported_data_to_model, currentStepName); } else {