Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLineMetaImporterTest.cs =================================================================== diff -u -r1de82b61e03283a14d380a48cd718ec65a98432d -r1537ed6c8364e79f9b4c869c95e3d9398a55a572 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLineMetaImporterTest.cs (.../ReferenceLineMetaImporterTest.cs) (revision 1de82b61e03283a14d380a48cd718ec65a98432d) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLineMetaImporterTest.cs (.../ReferenceLineMetaImporterTest.cs) (revision 1537ed6c8364e79f9b4c869c95e3d9398a55a572) @@ -74,19 +74,38 @@ public void Constructor_FilePathTooLong_ThrowsCriticalFileReadException() { // Setup - string pathToEmptyFolder = Path.Combine(testDataPath, new string('A', 260)); + string pathTooLong = Path.Combine(testDataPath, new string('A', 260)); // Call - TestDelegate call = () => new ReferenceLineMetaImporter(pathToEmptyFolder); + TestDelegate call = () => new ReferenceLineMetaImporter(pathTooLong); // Assert var expectedExceptionMessage = string.Format("Fout bij het lezen van bestand '{0}': De folder locatie is ongeldig.", - pathToEmptyFolder); + pathTooLong); CriticalFileReadException exception = Assert.Throws(call); Assert.AreEqual(expectedExceptionMessage, exception.Message); } [Test] + public void Constructor_FilePathDoesNotExist_ThrowsCriticalFileReadException() + { + // Setup + string pathToNonExistingFolder = Path.Combine(testDataPath, "I do not exist"); + + // Precondition + Assert.IsFalse(Directory.Exists(pathToNonExistingFolder)); + + // Call + TestDelegate call = () => new ReferenceLineMetaImporter(pathToNonExistingFolder); + + // Assert + var expectedExceptionMessage = string.Format("Fout bij het lezen van bestand '{0}': De folder locatie is ongeldig.", + pathToNonExistingFolder); + CriticalFileReadException exception = Assert.Throws(call); + Assert.AreEqual(expectedExceptionMessage, exception.Message); + } + + [Test] public void Constructor_EmptyFolder_ThrowsCriticalFileReadException() { // Setup