Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -r607ffd52f1196f68b1e13f59ba7920b27758d0f1 -r9ac0d49079a6cc44ea4d5c348a6628e234adc1d5 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 607ffd52f1196f68b1e13f59ba7920b27758d0f1) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 9ac0d49079a6cc44ea4d5c348a6628e234adc1d5) @@ -48,13 +48,13 @@ private static readonly string preprocessorDirectory = Path.Combine(testDataPath, "Preprocessor"); [Test] - public void Validate_ValidHydraulicBoundaryDatabase_ReturnsTrue() + public void Validate_ValidPaths_ReturnsTrue() { // Setup var valid = false; // Call - Action call = () => valid = WaveHeightCalculationService.Validate(validFilePath); + Action call = () => valid = WaveHeightCalculationService.Validate(validFilePath, preprocessorDirectory); // Assert TestHelper.AssertLogMessages(call, messages => @@ -68,14 +68,14 @@ } [Test] - public void Validate_InvalidHydraulicBoundaryDatabase_LogsErrorAndReturnsFalse() + public void Validate_InvalidHydraulicBoundaryDatabasePath_LogsErrorAndReturnsFalse() { // Setup string notValidFilePath = Path.Combine(testDataPath, "notexisting.sqlite"); var valid = true; // Call - Action call = () => valid = WaveHeightCalculationService.Validate(notValidFilePath); + Action call = () => valid = WaveHeightCalculationService.Validate(notValidFilePath, preprocessorDirectory); // Assert TestHelper.AssertLogMessages(call, messages => @@ -97,7 +97,7 @@ var valid = false; // Call - Action call = () => valid = WaveHeightCalculationService.Validate(notValidFilePath); + Action call = () => valid = WaveHeightCalculationService.Validate(notValidFilePath, preprocessorDirectory); // Assert TestHelper.AssertLogMessages(call, messages => @@ -112,6 +112,28 @@ } [Test] + public void Validate_InvalidPreprocessorDirectory_LogsErrorAndReturnsFalse() + { + // Setup + const string notValidPreprocessorDirectory = "Preprocessor"; + var valid = true; + + // Call + Action call = () => valid = WaveHeightCalculationService.Validate(validFilePath, notValidPreprocessorDirectory); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + string[] msgs = messages.ToArray(); + Assert.AreEqual(3, msgs.Length); + CalculationServiceTestHelper.AssertValidationStartMessage(msgs[0]); + StringAssert.StartsWith("De bestandsmap waar de preprocessor bestanden opslaat is ongeldig. De bestandsmap bestaat niet.", msgs[1]); + CalculationServiceTestHelper.AssertValidationEndMessage(msgs[2]); + }); + Assert.IsFalse(valid); + } + + [Test] public void Calculate_WaveHeightCalculationNull_ThrowArgumentNullException() { // Setup