Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -r3ed8e00da47ef2780e79688a9902e12b674e4cc0 -r736f04ea6f24399148ab8efd7f3b03ae8f8f56b5 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 3ed8e00da47ef2780e79688a9902e12b674e4cc0) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 736f04ea6f24399148ab8efd7f3b03ae8f8f56b5) @@ -154,11 +154,11 @@ const string calculationNotConvergedMessage = "calculationNotConvergedMessage"; const double norm = 1.0 / 30; - var testWaveHeightCalculator = new TestWaveHeightCalculator(); + var calculator = new TestWaveHeightCalculator(); var mockRepository = new MockRepository(); - var calculatorFactory = mockRepository.Stub(); - calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(testWaveHeightCalculator); + var calculatorFactory = mockRepository.StrictMock(); + calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(calculator); var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Stub(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Stub(calc => calc.GetCalculatedNotConvergedMessage(locationName)).Return(calculationNotConvergedMessage); @@ -175,8 +175,8 @@ // Assert AssessmentLevelCalculationInput expectedInput = CreateInput(hydraulicBoundaryLocation, norm); - AssertInput(expectedInput, testWaveHeightCalculator.ReceivedInputs.First()); - Assert.IsFalse(testWaveHeightCalculator.IsCanceled); + AssertInput(expectedInput, calculator.ReceivedInputs.First()); + Assert.IsFalse(calculator.IsCanceled); } mockRepository.VerifyAll(); } @@ -186,11 +186,11 @@ { // Setup string validFilePath = Path.Combine(testDataPath, validFile); - var testWaveHeightCalculator = new TestWaveHeightCalculator(); + var calculator = new TestWaveHeightCalculator(); var mockRepository = new MockRepository(); - var calculatorFactory = mockRepository.Stub(); - calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(testWaveHeightCalculator); + var calculatorFactory = mockRepository.StrictMock(); + calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(calculator); var calculationMessageProviderStub = mockRepository.Stub(); mockRepository.ReplayAll(); @@ -200,7 +200,7 @@ using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { var service = new WaveHeightCalculationService(); - testWaveHeightCalculator.CalculationFinishedHandler += (s, e) => service.Cancel(); + calculator.CalculationFinishedHandler += (s, e) => service.Cancel(); // Call service.Calculate(hydraulicBoundaryLocation, @@ -209,7 +209,7 @@ calculationMessageProviderStub); // Assert - Assert.IsTrue(testWaveHeightCalculator.IsCanceled); + Assert.IsTrue(calculator.IsCanceled); } mockRepository.VerifyAll(); } @@ -225,15 +225,15 @@ const string calculationFailedMessage = "calculationFailedMessage"; const double norm = 1.0 / 30; - var testWaveHeightCalculator = new TestWaveHeightCalculator + var calculator = new TestWaveHeightCalculator { LastErrorFileContent = "An error occurred", EndInFailure = true }; var mockRepository = new MockRepository(); - var calculatorFactory = mockRepository.Stub(); - calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(testWaveHeightCalculator); + var calculatorFactory = mockRepository.StrictMock(); + calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(calculator); var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Stub(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Stub(calc => calc.GetCalculationFailedMessage(null, null)).IgnoreArguments().Return(calculationFailedMessage); @@ -288,14 +288,14 @@ const string calculationFailedMessage = "calculationFailedUnexplainedMessage"; const double norm = 1.0 / 30; - var testWaveHeightCalculator = new TestWaveHeightCalculator + var calculator = new TestWaveHeightCalculator { EndInFailure = true }; var mockRepository = new MockRepository(); - var calculatorFactory = mockRepository.Stub(); - calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(testWaveHeightCalculator); + var calculatorFactory = mockRepository.StrictMock(); + calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(calculator); var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Stub(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Stub(calc => calc.GetCalculationFailedUnexplainedMessage(locationName)).Return(calculationFailedMessage); @@ -350,15 +350,15 @@ const string calculationFailedMessage = "calculationFailedMessage"; const double norm = 1.0 / 30; - var testWaveHeightCalculator = new TestWaveHeightCalculator + var calculator = new TestWaveHeightCalculator { LastErrorFileContent = "An error occurred", EndInFailure = false }; var mockRepository = new MockRepository(); - var calculatorFactory = mockRepository.Stub(); - calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(testWaveHeightCalculator); + var calculatorFactory = mockRepository.StrictMock(); + calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath)).Return(calculator); var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Stub(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Stub(calc => calc.GetCalculationFailedMessage(null, null)).IgnoreArguments().Return(calculationFailedMessage);