Index: Riskeer/Common/test/Riskeer.Common.IO.Test/HydraRing/HydraulicBoundaryDataHelperTest.cs =================================================================== diff -u -ra7c0cfafea7def8dc3ddfab157d94013d5eafbd7 -re86309a5cc9625893b0ff12588cf31e6f0ee05b2 --- Riskeer/Common/test/Riskeer.Common.IO.Test/HydraRing/HydraulicBoundaryDataHelperTest.cs (.../HydraulicBoundaryDataHelperTest.cs) (revision a7c0cfafea7def8dc3ddfab157d94013d5eafbd7) +++ Riskeer/Common/test/Riskeer.Common.IO.Test/HydraRing/HydraulicBoundaryDataHelperTest.cs (.../HydraulicBoundaryDataHelperTest.cs) (revision e86309a5cc9625893b0ff12588cf31e6f0ee05b2) @@ -193,6 +193,32 @@ Assert.IsFalse(isEqual); } + [Test] + public void IsCorrectHrdFile_HlcdFileWithInvalidPathChars_ThrowsCriticalFileReadException() + { + // Setup + string hlcdFilePath = validHlcdFilePath.Replace('h', Path.GetInvalidPathChars()[0]); + + // Call + void Test() => HydraulicBoundaryDataHelper.IsCorrectHrdFile(hlcdFilePath, validHrdFilePath); + + // Assert + Assert.Throws(Test); + } + + [Test] + public void IsCorrectHrdFile_HrdFileWithInvalidPathChars_ThrowsCriticalFileReadException() + { + // Setup + string hrdFilePath = validHrdFilePath.Replace('c', Path.GetInvalidPathChars()[0]); + + // Call + void Test() => HydraulicBoundaryDataHelper.IsCorrectHrdFile(validHlcdFilePath, hrdFilePath); + + // Assert + Assert.Throws(Test); + } + private static string GetFolderPathThatIsTooLong() { var stringBuilder = new StringBuilder();