Index: Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/Properties/Resources.Designer.cs =================================================================== diff -u -r6aec8d56eca1d311fe0696a3d5fa0389517f2ee9 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 6aec8d56eca1d311fe0696a3d5fa0389517f2ee9) +++ Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -109,6 +109,15 @@ } /// + /// Looks up a localized string similar to Bron- en doelprojectpad mogen niet leeg of ongedefinieerd zijn.. + /// + internal static string CommandMigrate_Source_Or_Destination_Null_Or_Empty { + get { + return ResourceManager.GetString("CommandMigrate_Source_Or_Destination_Null_Or_Empty", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Het projectbestand '{0}' is succesvol gemigreerd naar '{1}' (versie {2}).. /// internal static string CommandMigrate_Successful_Migration_From_Location_0_To_Location_1_Version_2 { Index: Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/Properties/Resources.resx =================================================================== diff -u -r6aec8d56eca1d311fe0696a3d5fa0389517f2ee9 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/Properties/Resources.resx (.../Resources.resx) (revision 6aec8d56eca1d311fe0696a3d5fa0389517f2ee9) +++ Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/Properties/Resources.resx (.../Resources.resx) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -144,4 +144,7 @@ MIGRATIEHULPPROGRAMMA + + Bron- en doelprojectpad mogen niet leeg of ongedefinieerd zijn. + \ No newline at end of file Index: Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/RingtoetsMigrationConsole.cs =================================================================== diff -u -r273718b68966164ac44881ed3d3f98f6805755eb -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/RingtoetsMigrationConsole.cs (.../RingtoetsMigrationConsole.cs) (revision 273718b68966164ac44881ed3d3f98f6805755eb) +++ Application/Ringtoets/src/Application.Ringtoets.MigrationConsole/RingtoetsMigrationConsole.cs (.../RingtoetsMigrationConsole.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -103,6 +103,10 @@ private static void MigrateCommand(string filepath, string toFilepath) { + if (string.IsNullOrEmpty(filepath) || string.IsNullOrEmpty(toFilepath)) + { + throw new ArgumentException(Resources.CommandMigrate_Source_Or_Destination_Null_Or_Empty); + } var migrator = new RingtoetsSqLiteDatabaseFileMigrator(); var sourceFile = new RingtoetsVersionedFile(filepath); Index: Application/Ringtoets/test/Application.Ringtoets.MigrationConsole.Test/RingtoetsMigrationConsoleTest.cs =================================================================== diff -u -r273718b68966164ac44881ed3d3f98f6805755eb -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Application/Ringtoets/test/Application.Ringtoets.MigrationConsole.Test/RingtoetsMigrationConsoleTest.cs (.../RingtoetsMigrationConsoleTest.cs) (revision 273718b68966164ac44881ed3d3f98f6805755eb) +++ Application/Ringtoets/test/Application.Ringtoets.MigrationConsole.Test/RingtoetsMigrationConsoleTest.cs (.../RingtoetsMigrationConsoleTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -101,6 +101,33 @@ } [Test] + public void ExecuteConsoleTool_InvalidArgumentsForMigrate_WritesHelpToConsoleWithErrorCode() + { + // Setup + var console = new RingtoetsMigrationConsole(); + string[] invalidCommand = + { + "", + "" + }; + + using (var consoleOutput = new ConsoleOutput()) + { + // Call + console.ExecuteConsoleTool(invalidCommand); + + // Assert + string expectedText = Environment.NewLine + + "Bron- en doelprojectpad mogen niet leeg of ongedefinieerd zijn." + + Environment.NewLine + Environment.NewLine + + GetConsoleFullDescription(); + string consoleText = consoleOutput.GetConsoleOutput(); + Assert.AreEqual(expectedText, consoleText); + Assert.AreEqual(ErrorCode.ErrorInvalidCommandLine, environmentControl.ErrorCodeCalled); + } + } + + [Test] [TestCase("FullTestProject164.rtd", "5", true)] [TestCase("UnsupportedVersion8.rtd", "8", false)] public void GivenConsole_WhenVersionSupportedCall_ThenReturnedIfSupported(string file, string fileVersion, bool isSupported) Index: Core/Common/src/Core.Common.Utils/IOUtils.cs =================================================================== diff -u -r6c1eddbd3f88a9dcedec6c113de50416073ddfb3 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Core/Common/src/Core.Common.Utils/IOUtils.cs (.../IOUtils.cs) (revision 6c1eddbd3f88a9dcedec6c113de50416073ddfb3) +++ Core/Common/src/Core.Common.Utils/IOUtils.cs (.../IOUtils.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -114,6 +114,7 @@ /// does not contain an invalid character, /// does not end with a directory or path separator (empty file name). /// + /// public static void ValidateFilePath(string path) { if (string.IsNullOrWhiteSpace(path)) @@ -132,7 +133,7 @@ var message = new FileReaderErrorMessageBuilder(path) .Build(string.Format(CultureInfo.CurrentCulture, Resources.Error_Path_cannot_contain_Characters_0_, - string.Join(", ", Path.GetInvalidFileNameChars()))); + string.Join(", ", Path.GetInvalidPathChars()))); throw new ArgumentException(message, e); } if (string.IsNullOrEmpty(name)) Index: Core/Common/test/Core.Common.IO.Test/Readers/SqLiteDatabaseReaderBaseTest.cs =================================================================== diff -u -r2aa9661130f20e88c41dac921ffb780573dcf799 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Core/Common/test/Core.Common.IO.Test/Readers/SqLiteDatabaseReaderBaseTest.cs (.../SqLiteDatabaseReaderBaseTest.cs) (revision 2aa9661130f20e88c41dac921ffb780573dcf799) +++ Core/Common/test/Core.Common.IO.Test/Readers/SqLiteDatabaseReaderBaseTest.cs (.../SqLiteDatabaseReaderBaseTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -87,7 +87,7 @@ // Assert var expectedMessage = new FileReaderErrorMessageBuilder(corruptPath) .Build(string.Format(UtilsResources.Error_Path_cannot_contain_Characters_0_, - string.Join(", ", Path.GetInvalidFileNameChars()))); + string.Join(", ", Path.GetInvalidPathChars()))); var exception = Assert.Throws(test); Assert.AreEqual(expectedMessage, exception.Message); } Index: Core/Common/test/Core.Common.Utils.Test/IOUtilsTest.cs =================================================================== diff -u -r6c1eddbd3f88a9dcedec6c113de50416073ddfb3 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Core/Common/test/Core.Common.Utils.Test/IOUtilsTest.cs (.../IOUtilsTest.cs) (revision 6c1eddbd3f88a9dcedec6c113de50416073ddfb3) +++ Core/Common/test/Core.Common.Utils.Test/IOUtilsTest.cs (.../IOUtilsTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -181,20 +181,20 @@ } [Test] - public void ValidateFilePath_PathContainingInvalidFileCharacters_ThrowsArgumentException() + public void ValidateFilePath_PathContainingInvalidPathCharacters_ThrowsArgumentException() { // Setup string path = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Utils, "validFile.txt"); - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); - string invalidPath = path.Replace('d', invalidFileNameChars[0]); + char[] invalidPathChars = Path.GetInvalidPathChars(); + string invalidPath = path.Replace('d', invalidPathChars[0]); // Call TestDelegate call = () => IOUtils.ValidateFilePath(invalidPath); // Assert var exception = Assert.Throws(call); - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet de volgende tekens bevatten: {1}", - invalidPath, string.Join(", ", invalidFileNameChars)); + string invalidChars = string.Join(", ", invalidPathChars); + var expectedMessage = $"Fout bij het lezen van bestand '{invalidPath}': bestandspad mag niet de volgende tekens bevatten: {invalidChars}"; Assert.AreEqual(expectedMessage, exception.Message); } Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/IO/WmtsConnectionInfoReaderTest.cs =================================================================== diff -u -rcfb8cddfe064c4aa4a1843846968554c918ba58f -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Core/Components/test/Core.Components.DotSpatial.Forms.Test/IO/WmtsConnectionInfoReaderTest.cs (.../WmtsConnectionInfoReaderTest.cs) (revision cfb8cddfe064c4aa4a1843846968554c918ba58f) +++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/IO/WmtsConnectionInfoReaderTest.cs (.../WmtsConnectionInfoReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -84,7 +84,7 @@ const string expectedMessage = "Fout bij het lezen van bestand 'c:/\".config': bestandspad " + "mag niet de volgende tekens bevatten: \", <, >, " + "|, \0, , , , , , , \a, \b, \t, \n, \v, \f, \r, " + - ", , , , , , , , , , , , , , , , , , :, *, ?, \\, /"; + ", , , , , , , , , , , , , , , , , "; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/IO/WmtsConnectionInfoWriterTest.cs =================================================================== diff -u -rcfb8cddfe064c4aa4a1843846968554c918ba58f -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Core/Components/test/Core.Components.DotSpatial.Forms.Test/IO/WmtsConnectionInfoWriterTest.cs (.../WmtsConnectionInfoWriterTest.cs) (revision cfb8cddfe064c4aa4a1843846968554c918ba58f) +++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/IO/WmtsConnectionInfoWriterTest.cs (.../WmtsConnectionInfoWriterTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -77,7 +77,7 @@ const string expectedMessage = "Fout bij het lezen van bestand 'c:/\".config': bestandspad " + "mag niet de volgende tekens bevatten: \", <, >, " + "|, \0, , , , , , , \a, \b, \t, \n, \v, \f, \r, " + - ", , , , , , , , , , , , , , , , , , :, *, ?, \\, /"; + ", , , , , , , , , , , , , , , , , "; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Core/Components/test/Core.Components.Gis.IO.Test/Readers/ShapeFileReaderBaseTest.cs =================================================================== diff -u -r8905298103eb01ce13dd5c1a2f267f879d4fda3e -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Core/Components/test/Core.Components.Gis.IO.Test/Readers/ShapeFileReaderBaseTest.cs (.../ShapeFileReaderBaseTest.cs) (revision 8905298103eb01ce13dd5c1a2f267f879d4fda3e) +++ Core/Components/test/Core.Components.Gis.IO.Test/Readers/ShapeFileReaderBaseTest.cs (.../ShapeFileReaderBaseTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -87,18 +87,18 @@ public void ParameteredConstructor_FilePathHasInvalidPathCharacter_ThrowArgumentException() { // Setup - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + char[] invalidPathChars = Path.GetInvalidPathChars(); string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Core.Components.Gis.IO, "traject_10-1.shp"); - string invalidFilePath = validFilePath.Replace("_", invalidFileNameChars[0].ToString()); + string invalidFilePath = validFilePath.Replace("_", invalidPathChars[0].ToString()); // Call TestDelegate call = () => new TestShapeFileReaderBase(invalidFilePath); // Assert var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet de volgende tekens bevatten: {1}", - invalidFilePath, string.Join(", ", invalidFileNameChars)); + invalidFilePath, string.Join(", ", invalidPathChars)); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Core/Components/test/Core.Components.Gis.IO.Test/Writers/ShapeFileWriterBaseTest.cs =================================================================== diff -u -ra7394bfd186c74ff8c0a080f158230670eb4d6d4 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Core/Components/test/Core.Components.Gis.IO.Test/Writers/ShapeFileWriterBaseTest.cs (.../ShapeFileWriterBaseTest.cs) (revision a7394bfd186c74ff8c0a080f158230670eb4d6d4) +++ Core/Components/test/Core.Components.Gis.IO.Test/Writers/ShapeFileWriterBaseTest.cs (.../ShapeFileWriterBaseTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -126,7 +126,7 @@ TestDelegate call = () => writer.SaveAs(filePath); // Assert - const string expectedMessage = "Fout bij het lezen van bestand 'c:/\".shp': bestandspad mag niet de volgende tekens bevatten: \", <, >, |, \0, , , , , , , \a, \b, \t, \n, \v, \f, \r, , , , , , , , , , , , , , , , , , , :, *, ?, \\, /"; + const string expectedMessage = "Fout bij het lezen van bestand 'c:/\".shp': bestandspad mag niet de volgende tekens bevatten: \", <, >, |, \0, , , , , , , \a, \b, \t, \n, \v, \f, \r, , , , , , , , , , , , , , , , , , "; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs =================================================================== diff -u -r0765637cd19a665cdd0ce28add4fc06499adc6b3 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs (.../DikeProfileDataReaderTest.cs) (revision 0765637cd19a665cdd0ce28add4fc06499adc6b3) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs (.../DikeProfileDataReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -79,11 +79,11 @@ public void ReadReferenceLine_FilePathHasInvalidPathCharacter_ThrowArgumentException() { // Setup - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + char[] invalidPathChars = Path.GetInvalidPathChars(); string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("DikeProfiles", "profiel001 - Ringtoets.prfl")); - string invalidFilePath = validFilePath.Replace("-", invalidFileNameChars[3].ToString()); + string invalidFilePath = validFilePath.Replace("-", invalidPathChars[3].ToString()); var reader = new DikeProfileDataReader(new string[0]); @@ -92,7 +92,7 @@ // Assert var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet de volgende tekens bevatten: {1}", - invalidFilePath, string.Join(", ", invalidFileNameChars)); + invalidFilePath, string.Join(", ", invalidPathChars)); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs =================================================================== diff -u -r2aa9661130f20e88c41dac921ffb780573dcf799 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs (.../ProfileLocationReaderTest.cs) (revision 2aa9661130f20e88c41dac921ffb780573dcf799) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs (.../ProfileLocationReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -67,18 +67,18 @@ public void Constructor_FilePathHasInvalidPathCharacter_ThrowArgumentException() { // Setup - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + char[] invalidPathChars = Path.GetInvalidPathChars(); string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); - string invalidFilePath = validFilePath.Replace("1", invalidFileNameChars[1].ToString()); + string invalidFilePath = validFilePath.Replace("1", invalidPathChars[1].ToString()); // Call TestDelegate call = () => new ProfileLocationReader(invalidFilePath); // Assert var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet de volgende tekens bevatten: {1}", - invalidFilePath, string.Join(", ", invalidFileNameChars)); + invalidFilePath, string.Join(", ", invalidPathChars)); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs =================================================================== diff -u -r2aa9661130f20e88c41dac921ffb780573dcf799 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs (.../FailureMechanismSectionReaderTest.cs) (revision 2aa9661130f20e88c41dac921ffb780573dcf799) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs (.../FailureMechanismSectionReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -67,18 +67,18 @@ public void Constructor_FilePathHasInvalidPathCharacter_ThrowArgumentException() { // Setup - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + char[] invalidPathChars = Path.GetInvalidPathChars(); string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "traject_1-1_vakken.shp"); - string invalidFilePath = validFilePath.Replace("_", invalidFileNameChars[1].ToString()); + string invalidFilePath = validFilePath.Replace("_", invalidPathChars[1].ToString()); // Call TestDelegate call = () => new FailureMechanismSectionReader(invalidFilePath); // Assert var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet de volgende tekens bevatten: {1}", - invalidFilePath, string.Join(", ", invalidFileNameChars)); + invalidFilePath, string.Join(", ", invalidPathChars)); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/HydraulicBoundaryDatabaseImporterTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/HydraulicBoundaryDatabaseImporterTest.cs (.../HydraulicBoundaryDatabaseImporterTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/HydraulicBoundaryDatabaseImporterTest.cs (.../HydraulicBoundaryDatabaseImporterTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -124,7 +124,7 @@ // Assert var expectedMessage = new FileReaderErrorMessageBuilder(invalidPath) .Build(string.Format(UtilsResources.Error_Path_cannot_contain_Characters_0_, - string.Join(", ", Path.GetInvalidFileNameChars()))); + string.Join(", ", Path.GetInvalidPathChars()))); CriticalFileReadException exception = Assert.Throws(test); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/ProfilesImporterTest.cs =================================================================== diff -u -ra666c7d6aa029937de402e181f119c72707bfb73 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/ProfilesImporterTest.cs (.../ProfilesImporterTest.cs) (revision a666c7d6aa029937de402e181f119c72707bfb73) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/ProfilesImporterTest.cs (.../ProfilesImporterTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -111,12 +111,12 @@ } [Test] - public void Import_FromPathContainingInvalidFileCharacters_FalseAndLogError() + public void Import_FromPathContainingInvalidPathCharacters_FalseAndLogError() { // Setup string filePath = "c:\\Invalid_Characters.shp"; - var invalidFileNameChars = Path.GetInvalidFileNameChars(); + var invalidFileNameChars = Path.GetInvalidPathChars(); var invalidPath = filePath.Replace('_', invalidFileNameChars[0]); var testProfilesImporter = new TestProfilesImporter(testImportTarget, testReferenceLine, invalidPath); @@ -130,7 +130,7 @@ { string message = messages.First(); string expectedMessage = new FileReaderErrorMessageBuilder(invalidPath) - .Build(string.Format(CoreCommonUtilsResources.Error_Path_cannot_contain_Characters_0_, string.Join(", ", Path.GetInvalidFileNameChars()))); + .Build(string.Format(CoreCommonUtilsResources.Error_Path_cannot_contain_Characters_0_, string.Join(", ", Path.GetInvalidPathChars()))); StringAssert.StartsWith(expectedMessage, message); }); Assert.IsFalse(importResult); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/StructuresImporterTest.cs =================================================================== diff -u -ra666c7d6aa029937de402e181f119c72707bfb73 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/StructuresImporterTest.cs (.../StructuresImporterTest.cs) (revision a666c7d6aa029937de402e181f119c72707bfb73) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/StructuresImporterTest.cs (.../StructuresImporterTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -112,13 +112,13 @@ } [Test] - public void Import_FromPathContainingInvalidFileCharacters_FalseAndLogError() + public void Import_FromPathContainingInvalidPathCharacters_FalseAndLogError() { // Setup string filePath = "c:\\Invalid_Characters.shp"; - var invalidFileNameChars = Path.GetInvalidFileNameChars(); - var invalidPath = filePath.Replace('_', invalidFileNameChars[0]); + var invalidPathChars = Path.GetInvalidPathChars(); + var invalidPath = filePath.Replace('_', invalidPathChars[0]); var testStructuresImporter = new TestStructuresImporter(testImportTarget, testReferenceLine, invalidPath); @@ -131,7 +131,7 @@ { string message = messages.First(); string expectedMessage = new FileReaderErrorMessageBuilder(invalidPath) - .Build(string.Format(CoreCommonUtilsResources.Error_Path_cannot_contain_Characters_0_, string.Join(", ", invalidFileNameChars))); + .Build(string.Format(CoreCommonUtilsResources.Error_Path_cannot_contain_Characters_0_, string.Join(", ", invalidPathChars))); StringAssert.StartsWith(expectedMessage, message); }); Assert.IsFalse(importResult); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs =================================================================== diff -u -r2aa9661130f20e88c41dac921ffb780573dcf799 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs (.../ReferenceLineReaderTest.cs) (revision 2aa9661130f20e88c41dac921ffb780573dcf799) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs (.../ReferenceLineReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -76,11 +76,11 @@ public void ReadReferenceLine_FilePathHasInvalidPathCharacter_ThrowArgumentException() { // Setup - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + char[] invalidPathChars = Path.GetInvalidPathChars(); string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "traject_10-1.shp"); - string invalidFilePath = validFilePath.Replace("_", invalidFileNameChars[3].ToString()); + string invalidFilePath = validFilePath.Replace("_", invalidPathChars[3].ToString()); var reader = new ReferenceLineReader(); @@ -89,7 +89,7 @@ // Assert var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet de volgende tekens bevatten: {1}", - invalidFilePath, string.Join(", ", invalidFileNameChars)); + invalidFilePath, string.Join(", ", invalidPathChars)); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLinesMetaReaderTest.cs =================================================================== diff -u -r2aa9661130f20e88c41dac921ffb780573dcf799 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLinesMetaReaderTest.cs (.../ReferenceLinesMetaReaderTest.cs) (revision 2aa9661130f20e88c41dac921ffb780573dcf799) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLinesMetaReaderTest.cs (.../ReferenceLinesMetaReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -56,17 +56,17 @@ public void ReadReferenceLinesMetas_FilePathHasInvalidPathCharacter_ThrowArgumentException() { // Setup - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + char[] invalidPathChars = Path.GetInvalidPathChars(); string validFilePath = Path.Combine(testDataPath, "NBPW.shp"); - string invalidFilePath = validFilePath.Replace("P", invalidFileNameChars[1].ToString()); + string invalidFilePath = validFilePath.Replace("P", invalidPathChars[1].ToString()); // Call TestDelegate call = () => ReferenceLinesMetaReader.ReadReferenceLinesMetas(invalidFilePath); // Assert var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet de volgende tekens bevatten: {1}", - invalidFilePath, string.Join(", ", invalidFileNameChars)); + invalidFilePath, string.Join(", ", invalidPathChars)); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs =================================================================== diff -u -r2aa9661130f20e88c41dac921ffb780573dcf799 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs (.../StructureLocationReaderTest.cs) (revision 2aa9661130f20e88c41dac921ffb780573dcf799) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs (.../StructureLocationReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -67,18 +67,18 @@ public void Constructor_FilePathHasInvalidPathCharacter_ThrowArgumentException() { // Setup - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + char[] invalidPathChars = Path.GetInvalidPathChars(); string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, Path.Combine("Structures", "CorrectFiles", "Kunstwerken.shp")); - string invalidFilePath = validFilePath.Replace("e", invalidFileNameChars[1].ToString()); + string invalidFilePath = validFilePath.Replace("e", invalidPathChars[1].ToString()); // Call TestDelegate call = () => new StructureLocationReader(invalidFilePath); // Assert var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': bestandspad mag niet de volgende tekens bevatten: {1}", - invalidFilePath, string.Join(", ", invalidFileNameChars)); + invalidFilePath, string.Join(", ", invalidPathChars)); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs =================================================================== diff -u -r2aa9661130f20e88c41dac921ffb780573dcf799 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs (.../StructuresCharacteristicsCsvReaderTest.cs) (revision 2aa9661130f20e88c41dac921ffb780573dcf799) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructuresCharacteristicsCsvReaderTest.cs (.../StructuresCharacteristicsCsvReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -64,7 +64,7 @@ // Assert string innerExpectedMessage = string.Format(UtilsResources.Error_Path_cannot_contain_Characters_0_, - string.Join(", ", Path.GetInvalidFileNameChars())); + string.Join(", ", Path.GetInvalidPathChars())); string expectedMessage = new FileReaderErrorMessageBuilder(corruptPath).Build(innerExpectedMessage); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs =================================================================== diff -u -refdfbe3c54d3743aa50b0fc7be73e417638f2732 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs (.../PipingConfigurationReaderTest.cs) (revision efdfbe3c54d3743aa50b0fc7be73e417638f2732) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs (.../PipingConfigurationReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -53,16 +53,16 @@ public void Constructor_FilePathHasInvalidPathCharacter_ThrowArgumentException() { // Setup - char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + char[] invalidPathChars = Path.GetInvalidPathChars(); string validFilePath = Path.Combine(testDirectoryPath, "validPipingConfiguration.xml"); - string invalidFilePath = validFilePath.Replace("Piping", invalidFileNameChars[3].ToString()); + string invalidFilePath = validFilePath.Replace("Piping", invalidPathChars[3].ToString()); // Call TestDelegate call = () => new PipingConfigurationReader(invalidFilePath); // Assert - string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet de volgende tekens bevatten: {string.Join(", ", invalidFileNameChars)}"; + string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet de volgende tekens bevatten: {string.Join(", ", invalidPathChars)}"; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs =================================================================== diff -u -r2d7f22520e157ccfefbf12a4d9845de8bfb04f50 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs (.../CharacteristicPointsCsvReaderTest.cs) (revision 2d7f22520e157ccfefbf12a4d9845de8bfb04f50) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs (.../CharacteristicPointsCsvReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -66,7 +66,7 @@ // Assert string innerErrorMessage = string.Format(UtilsResources.Error_Path_cannot_contain_Characters_0_, - string.Join(", ", Path.GetInvalidFileNameChars())); + string.Join(", ", Path.GetInvalidPathChars())); string expectedMessage = new FileReaderErrorMessageBuilder(corruptPath).Build(innerErrorMessage); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/PipingSurfaceLinesCsvReaderTest.cs =================================================================== diff -u -r2d7f22520e157ccfefbf12a4d9845de8bfb04f50 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/PipingSurfaceLinesCsvReaderTest.cs (.../PipingSurfaceLinesCsvReaderTest.cs) (revision 2d7f22520e157ccfefbf12a4d9845de8bfb04f50) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/PipingSurfaceLinesCsvReaderTest.cs (.../PipingSurfaceLinesCsvReaderTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -68,7 +68,7 @@ // Assert string innerExpectedMessage = string.Format(UtilsResources.Error_Path_cannot_contain_Characters_0_, - string.Join(", ", Path.GetInvalidFileNameChars())); + string.Join(", ", Path.GetInvalidPathChars())); string expectedMessage = new FileReaderErrorMessageBuilder(corruptPath).Build(innerExpectedMessage); TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs =================================================================== diff -u -r425a1030cf1f383e0a8f5cbd712c52c5cc2d3369 -r808d8de82712c31f26cf21ea82f849d7bb728caa --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs (.../PipingSurfaceLinesCsvImporterTest.cs) (revision 425a1030cf1f383e0a8f5cbd712c52c5cc2d3369) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs (.../PipingSurfaceLinesCsvImporterTest.cs) (revision 808d8de82712c31f26cf21ea82f849d7bb728caa) @@ -421,7 +421,7 @@ // Assert string internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath).Build(string.Format(UtilsResources.Error_Path_cannot_contain_Characters_0_, - string.Join(", ", Path.GetInvalidFileNameChars()))); + string.Join(", ", Path.GetInvalidPathChars()))); var expectedLogMessage = string.Format(PipingPluginResources.PipingSurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, internalErrorMessage); TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1);