Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs =================================================================== diff -u -ref3fadb8742f1c2e60d2278a9d9a4639e1a4f44d -r211ed9d209b72a515105428e9ad08ec6972ad95d --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision ef3fadb8742f1c2e60d2278a9d9a4639e1a4f44d) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 211ed9d209b72a515105428e9ad08ec6972ad95d) @@ -239,6 +239,49 @@ } [Test] + public void Calculate_ValidDesignWaterLevelCalculationWithIllustrationPointsButIsNull_ThrowsHydraRingCalculationException() + { + // Setup + string validFilePath = Path.Combine(testDataPath, validFile); + + const string locationName = "punt_flw_ 1"; + + var mockRepository = new MockRepository(); + var calculator = new TestDesignWaterLevelCalculator(); + + var calculatorFactory = mockRepository.StrictMock(); + calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath)).Return(calculator); + + var calculation = mockRepository.Stub(); + calculation.Stub(c => c.Name).Return(locationName); + calculation.Expect(c => c.Id).Return(100); + calculation.Expect(c => c.CalculateIllustrationPoints).Return(true); + + var calculationMessageProvider = mockRepository.StrictMock(); + calculationMessageProvider.Stub(calc => calc.GetCalculationName(locationName)).Return(string.Empty); + calculationMessageProvider.Stub(calc => calc.GetCalculatedNotConvergedMessage(locationName)).Return(string.Empty); + calculationMessageProvider.Stub(calc => calc.GetCalculationFailedMessage( + locationName, "Er konden geen illustratiepunten worden uitgelezen.")) + .Return(string.Empty); + mockRepository.ReplayAll(); + + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) + { + // Call + TestDelegate call = () => new DesignWaterLevelCalculationService() + .Calculate(calculation, + validFilePath, + 1.0 / 30, + calculationMessageProvider); + + // Assert + var thrownException = Assert.Throws(call); + Assert.AreEqual("Er konden geen illustratiepunten worden uitgelezen.", thrownException.Message); + } + mockRepository.VerifyAll(); + } + + [Test] public void Calculate_ValidDesignWaterLevelCalculationWithIllustrationPoints_StartsCalculationWithRightParameters() { // Setup