Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs =================================================================== diff -u -r893c37884e74d551780cfd9cb4b9899779832650 -r058c36d676ce75456e648d75e460c24f0bc06ae7 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 893c37884e74d551780cfd9cb4b9899779832650) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 058c36d676ce75456e648d75e460c24f0bc06ae7) @@ -135,10 +135,6 @@ // Setup string validFilePath = Path.Combine(testDataPath, validFile); - const long id = 100; - const string locationName = "punt_flw_ 1"; - const double norm = 1.0 / 30; - var calculator = new TestDesignWaterLevelCalculator { IllustrationPointsResult = new TestGeneralResult(), @@ -150,8 +146,8 @@ 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(id); + calculation.Stub(c => c.Name).Return("punt_flw_ 1"); + calculation.Expect(c => c.Id).Return(100); calculation.Expect(c => c.CalculateIllustrationPoints).Return(calculateIllustrationPoints); var calculationMessageProvider = mockRepository.StrictMock(); @@ -162,7 +158,7 @@ // Call Action call = () => new DesignWaterLevelCalculationService().Calculate(calculation, validFilePath, - norm, + 1.0 / 30, calculationMessageProvider); // Assert @@ -176,7 +172,7 @@ CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[2]); }); - AssessmentLevelCalculationInput expectedInput = CreateInput(id, norm); + AssessmentLevelCalculationInput expectedInput = CreateInput(100, 1.0 / 30); AssertInput(expectedInput, calculator.ReceivedInputs.Single()); Assert.IsFalse(calculator.IsCanceled); @@ -193,8 +189,6 @@ // Setup string validFilePath = Path.Combine(testDataPath, validFile); - const long id = 100; - const string locationName = "punt_flw_ 1"; const double norm = 1.0 / 30; var calculator = new TestDesignWaterLevelCalculator @@ -208,13 +202,13 @@ 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(id); + calculation.Stub(c => c.Name).Return("punt_flw_ 1"); + calculation.Expect(c => c.Id).Return(100); calculation.Expect(c => c.CalculateIllustrationPoints).Return(readIllustrationPoints); const string failedConvergenceMessage = "Did not converge"; var calculationMessageProvider = mockRepository.StrictMock(); - calculationMessageProvider.Expect(c => c.GetCalculatedNotConvergedMessage(locationName)).Return(failedConvergenceMessage); + calculationMessageProvider.Expect(c => c.GetCalculatedNotConvergedMessage("punt_flw_ 1")).Return(failedConvergenceMessage); mockRepository.ReplayAll(); using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) @@ -237,7 +231,7 @@ CalculationServiceTestHelper.AssertCalculationEndMessage(msgs[3]); }); - AssessmentLevelCalculationInput expectedInput = CreateInput(id, norm); + AssessmentLevelCalculationInput expectedInput = CreateInput(100, norm); AssertInput(expectedInput, calculator.ReceivedInputs.Single()); Assert.IsFalse(calculator.IsCanceled); Assert.IsNotNull(calculation.Output); @@ -252,10 +246,6 @@ // Setup string validFilePath = Path.Combine(testDataPath, validFile); - const long id = 100; - const string locationName = "punt_flw_ 1"; - const double norm = 1.0 / 30; - var calculator = new TestDesignWaterLevelCalculator { IllustrationPointsResult = TestGeneralResult.CreateGeneralResultWithFaultTreeIllustrationPoints(), @@ -267,8 +257,8 @@ 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(id); + calculation.Stub(c => c.Name).Return("punt_flw_ 1"); + calculation.Expect(c => c.Id).Return(100); calculation.Expect(c => c.CalculateIllustrationPoints).Return(true); var calculationMessageProvider = mockRepository.StrictMock(); @@ -279,7 +269,7 @@ // Call Action call = () => new DesignWaterLevelCalculationService().Calculate(calculation, validFilePath, - norm, + 1.0 / 30, calculationMessageProvider); // Assert @@ -310,7 +300,6 @@ // Setup string validFilePath = Path.Combine(testDataPath, validFile); - const string locationName = "punt_flw_ 1"; var expectedException = new HydraRingFileParserException(); var mockRepository = new MockRepository(); @@ -324,11 +313,11 @@ calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath)).Return(calculator); var calculation = mockRepository.Stub(); - calculation.Stub(c => c.Name).Return(locationName); + calculation.Stub(c => c.Name).Return("punt_flw_ 1"); calculation.Expect(c => c.Id).Return(100); var calculationMessageProvider = mockRepository.Stub(); - calculationMessageProvider.Stub(mp => mp.GetCalculatedNotConvergedMessage(locationName)).Return(string.Empty); + calculationMessageProvider.Stub(mp => mp.GetCalculatedNotConvergedMessage("punt_flw_ 1")).Return(string.Empty); mockRepository.ReplayAll(); using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) @@ -353,8 +342,6 @@ // Setup string validFilePath = Path.Combine(testDataPath, validFile); - const string locationName = "punt_flw_ 1"; - const string parserErrorMessage = "Some Error Message"; var mockRepository = new MockRepository(); var calculator = new TestDesignWaterLevelCalculator @@ -367,7 +354,7 @@ calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath)).Return(calculator); var calculation = mockRepository.Stub(); - calculation.Stub(c => c.Name).Return(locationName); + calculation.Stub(c => c.Name).Return("punt_flw_ 1"); calculation.Expect(c => c.Id).Return(100); calculation.Expect(c => c.CalculateIllustrationPoints).Return(true); @@ -405,8 +392,6 @@ // Setup string validFilePath = Path.Combine(testDataPath, validFile); - const string locationName = "punt_flw_ 1"; - var mockRepository = new MockRepository(); var calculator = new TestDesignWaterLevelCalculator { @@ -418,7 +403,7 @@ calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath)).Return(calculator); var calculation = mockRepository.Stub(); - calculation.Stub(c => c.Name).Return(locationName); + calculation.Stub(c => c.Name).Return("punt_flw_ 1"); calculation.Expect(c => c.Id).Return(100); calculation.Expect(c => c.CalculateIllustrationPoints).Return(false);