Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -rb0aaf56d72d242f5d1112d007bfbf51826f5ea59 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision b0aaf56d72d242f5d1112d007bfbf51826f5ea59) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -112,21 +112,21 @@ const double norm = 30; var mockRepository = new MockRepository(); - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1300001).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationFailedMessage(locationName)).Return(calculationFailedMessage); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1300001, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN), + }; + using (new HydraRingCalculationServiceConfig()) { var testService = (TestHydraRingCalculationService) HydraRingCalculationService.Instance; - WaveHeightCalculationService.Instance.Calculate(hydraulicBoundaryLocationMock, + WaveHeightCalculationService.Instance.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -139,7 +139,7 @@ var parsers = testService.Parsers.ToArray(); Assert.AreEqual(1, parsers.Length); Assert.IsInstanceOf(parsers[0]); - var expectedInput = CreateInput(hydraulicBoundaryLocationMock, norm); + var expectedInput = CreateInput(hydraulicBoundaryLocation, norm); AssertInput(expectedInput, testService.HydraRingCalculationInput); } mockRepository.VerifyAll(); @@ -157,21 +157,21 @@ const double norm = 30; var mockRepository = new MockRepository(); - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationFailedMessage(locationName)).Return(calculationFailedMessage).Repeat.AtLeastOnce(); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN), + }; + ReliabilityIndexCalculationOutput output = null; using (new HydraRingCalculationServiceConfig()) { // Call - Action call = () => output = WaveHeightCalculationService.Instance.Calculate(hydraulicBoundaryLocationMock, + Action call = () => output = WaveHeightCalculationService.Instance.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -198,7 +198,7 @@ Assert.AreEqual(expectedInput.Beta, hydraRingCalculationInput.Beta); } - private static AssessmentLevelCalculationInput CreateInput(IHydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) + private static AssessmentLevelCalculationInput CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) { return new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, norm); }