Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraulicBoundaryLocationCalculationServiceTest.cs =================================================================== diff -u -r5fca1638d8f9510eebe352a8a9a86551d7ce9e61 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraulicBoundaryLocationCalculationServiceTest.cs (.../HydraulicBoundaryLocationCalculationServiceTest.cs) (revision 5fca1638d8f9510eebe352a8a9a86551d7ce9e61) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraulicBoundaryLocationCalculationServiceTest.cs (.../HydraulicBoundaryLocationCalculationServiceTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -116,24 +116,24 @@ 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; var service = new TestHydraulicBoundaryLocationCalculationService(); // Call - service.Calculate(hydraulicBoundaryLocationMock, + service.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -146,7 +146,7 @@ var parsers = testService.Parsers.ToArray(); Assert.AreEqual(1, parsers.Length); Assert.IsInstanceOf(parsers[0]); - var expectedInput = new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocationMock.Id, norm); + var expectedInput = new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, norm); AssertInput(expectedInput, testService.HydraRingCalculationInput); } mockRepository.VerifyAll(); @@ -165,23 +165,23 @@ 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); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN) + }; + ReliabilityIndexCalculationOutput output = null; using (new HydraRingCalculationServiceConfig()) { var service = new TestHydraulicBoundaryLocationCalculationService(); // Call - Action call = () => output = service.Calculate(hydraulicBoundaryLocationMock, + Action call = () => output = service.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -210,7 +210,7 @@ private class TestHydraulicBoundaryLocationCalculationService : HydraulicBoundaryLocationCalculationService { - protected override AssessmentLevelCalculationInput CreateInput(IHydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) + protected override AssessmentLevelCalculationInput CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) { return new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, norm); }