Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Service.Test/WaveConditionsCalculationServiceBaseTest.cs =================================================================== diff -u -r6ddf92411860d3f692da3018e1662e633003e0a9 -ra42bae106b7a5afd5ffb2a405c1265828a323588 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Service.Test/WaveConditionsCalculationServiceBaseTest.cs (.../WaveConditionsCalculationServiceBaseTest.cs) (revision 6ddf92411860d3f692da3018e1662e633003e0a9) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Service.Test/WaveConditionsCalculationServiceBaseTest.cs (.../WaveConditionsCalculationServiceBaseTest.cs) (revision a42bae106b7a5afd5ffb2a405c1265828a323588) @@ -447,6 +447,44 @@ } } + [Test] + public void Calculate_CancelCalculationWithValidInput_CancelsCalculator() + { + // Setup + RoundedDouble waterLevel = new RoundedDouble(2, 4.00); + RoundedDouble a = (RoundedDouble)1.0; + RoundedDouble b = (RoundedDouble)0.8; + RoundedDouble c = (RoundedDouble)0.4; + int norm = 5; + var input = new WaveConditionsInput + { + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 0, 0) + { + DesignWaterLevel = (RoundedDouble)4.2 + }, + ForeshoreProfile = CreateForeshoreProfile(), + UpperBoundaryRevetment = waterLevel, + LowerBoundaryRevetment = (RoundedDouble)3 + }; + + string hlcdDirectory = "C:/temp"; + string ringId = "11-1"; + string name = "test"; + + using (new HydraRingCalculatorFactoryConfig()) + { + var testCalculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).WaveConditionsCosineCalculator; + var service = new WaveConditionsCalculationService(); + + // Call + service.PublicCalculate(a, b, c, norm, input, hlcdDirectory, ringId, name); + service.Cancel(); + + // Assert + Assert.IsTrue(testCalculator.IsCanceled); + } + } + public enum CalculationType { NoForeshore,