Index: Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs =================================================================== diff -u -r35525b6135cc111e4af3803f7dcce0d7528bbb16 -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs (.../HydraulicBoundaryLocationCalculationGuiService.cs) (revision 35525b6135cc111e4af3803f7dcce0d7528bbb16) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs (.../HydraulicBoundaryLocationCalculationGuiService.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -57,7 +57,7 @@ this.viewParent = viewParent; } - public bool CalculateDesignWaterLevels(string hydraulicBoundaryDatabaseFilePath, + public void CalculateDesignWaterLevels(string hydraulicBoundaryDatabaseFilePath, string preprocessorDirectory, IEnumerable locations, double norm, @@ -73,16 +73,16 @@ throw new ArgumentNullException(nameof(locations)); } - return RunActivities(hydraulicBoundaryDatabaseFilePath, - preprocessorDirectory, - locations.Select(location => new DesignWaterLevelCalculationActivity(new DesignWaterLevelCalculation(location), - hydraulicBoundaryDatabaseFilePath, - preprocessorDirectory, - norm, - messageProvider)).ToArray()); + RunActivities(hydraulicBoundaryDatabaseFilePath, + preprocessorDirectory, + locations.Select(location => new DesignWaterLevelCalculationActivity(new DesignWaterLevelCalculation(location), + hydraulicBoundaryDatabaseFilePath, + preprocessorDirectory, + norm, + messageProvider)).ToArray()); } - public bool CalculateWaveHeights(string hydraulicBoundaryDatabaseFilePath, + public void CalculateWaveHeights(string hydraulicBoundaryDatabaseFilePath, string preprocessorDirectory, IEnumerable locations, double norm, @@ -98,29 +98,28 @@ throw new ArgumentNullException(nameof(locations)); } - return RunActivities(hydraulicBoundaryDatabaseFilePath, - preprocessorDirectory, - locations.Select(location => new WaveHeightCalculationActivity(new WaveHeightCalculation(location), - hydraulicBoundaryDatabaseFilePath, - preprocessorDirectory, - norm, - messageProvider)).ToArray()); + RunActivities(hydraulicBoundaryDatabaseFilePath, + preprocessorDirectory, + locations.Select(location => new WaveHeightCalculationActivity(new WaveHeightCalculation(location), + hydraulicBoundaryDatabaseFilePath, + preprocessorDirectory, + norm, + messageProvider)).ToArray()); } - private bool RunActivities(string hydraulicBoundaryDatabasePath, string preprocessorDirectory, + private void RunActivities(string hydraulicBoundaryDatabasePath, string preprocessorDirectory, IEnumerable activities) where TActivity : Activity { string validationProblem = HydraulicBoundaryDatabaseHelper.ValidateFilesForCalculation(hydraulicBoundaryDatabasePath, preprocessorDirectory); if (string.IsNullOrEmpty(validationProblem)) { ActivityProgressDialogRunner.Run(viewParent, activities); - - return true; + return; } + log.ErrorFormat(Resources.CalculateHydraulicBoundaryLocation_Start_calculation_failed_0_, validationProblem); - return false; } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs =================================================================== diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs (.../IHydraulicBoundaryLocationCalculationGuiService.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs (.../IHydraulicBoundaryLocationCalculationGuiService.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -41,13 +41,12 @@ /// the for. /// The norm to use during the calculation. /// The message provider for the services. - /// True if the observers should be notified; false if otherwise /// Preprocessing is disabled when /// equals . /// Thrown when , /// , or /// or is null. - bool CalculateDesignWaterLevels(string hydraulicBoundaryDatabaseFilePath, + void CalculateDesignWaterLevels(string hydraulicBoundaryDatabaseFilePath, string preprocessorDirectory, IEnumerable locations, double norm, @@ -62,13 +61,12 @@ /// the for. /// The norm to use during the calculation. /// The message provider for the services. - /// True if the observers should be notified; false if otherwise /// Preprocessing is disabled when /// equals . /// Thrown when , /// , or /// or is null. - bool CalculateWaveHeights(string hydraulicBoundaryDatabaseFilePath, + void CalculateWaveHeights(string hydraulicBoundaryDatabaseFilePath, string preprocessorDirectory, IEnumerable locations, double norm, Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs =================================================================== diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs (.../HydraulicBoundaryLocationCalculationGuiServiceTest.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs (.../HydraulicBoundaryLocationCalculationGuiServiceTest.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -147,40 +147,20 @@ } [Test] - public void CalculateDesignWaterLevels_HydraulicDatabaseDoesNotExist_SuccessfulCalculationFalse() + public void CalculateDesignWaterLevels_ValidPathEmptyList_NoLog() { // Setup var calculatorFactory = mockRepository.StrictMock(); var calculationMessageProvider = mockRepository.StrictMock(); mockRepository.ReplayAll(); - using (var viewParent = new Form()) - using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) - { - var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); - - // Call - bool successfulCalculation = guiService.CalculateDesignWaterLevels("Does not exist", validPreprocessorDirectory, Enumerable.Empty(), 1, calculationMessageProvider); - - // Assert - Assert.IsFalse(successfulCalculation); - } - mockRepository.VerifyAll(); - } - - [Test] - public void CalculateDesignWaterLevels_ValidPathEmptyList_NoLog() - { - // Setup - var calculationMessageProvider = mockRepository.StrictMock(); - mockRepository.ReplayAll(); - DialogBoxHandler = (name, wnd) => { // Expect an activity dialog which is automatically closed }; using (var viewParent = new Form()) + using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); @@ -194,33 +174,6 @@ } [Test] - public void CalculateDesignWaterLevels_ValidPathEmptyList_SuccessfulCalculationTrue() - { - // Setup - var calculatorFactory = mockRepository.StrictMock(); - var calculationMessageProvider = mockRepository.StrictMock(); - mockRepository.ReplayAll(); - - DialogBoxHandler = (name, wnd) => - { - // Expect an activity dialog which is automatically closed - }; - - using (var viewParent = new Form()) - using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) - { - var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); - - // Call - bool successfulCalculation = guiService.CalculateDesignWaterLevels(validFilePath, validPreprocessorDirectory, Enumerable.Empty(), 1, calculationMessageProvider); - - // Assert - Assert.IsTrue(successfulCalculation); - } - mockRepository.VerifyAll(); - } - - [Test] public void CalculateDesignWaterLevels_ValidPathOneLocationInTheList_LogsMessages() { // Setup @@ -273,44 +226,6 @@ } [Test] - public void CalculateDesignWaterLevels_ValidPathOneLocationInTheList_SuccessfulCalculationTrue() - { - // Setup - const string hydraulicLocationName = "name"; - - var calculatorFactory = mockRepository.StrictMock(); - calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(testDataPath, validPreprocessorDirectory)).Return(new TestDesignWaterLevelCalculator()); - var calculationMessageProvider = mockRepository.StrictMock(); - calculationMessageProvider.Expect(calc => calc.GetActivityDescription(hydraulicLocationName)).Return(string.Empty); - calculationMessageProvider.Expect(calc => calc.GetCalculatedNotConvergedMessage(hydraulicLocationName)).Return(string.Empty); - mockRepository.ReplayAll(); - - DialogBoxHandler = (name, wnd) => - { - // Expect an activity dialog which is automatically closed - }; - - using (var viewParent = new Form()) - using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) - { - var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); - - // Call - bool successfulCalculation = guiService.CalculateDesignWaterLevels(validFilePath, - validPreprocessorDirectory, - new List - { - new TestHydraulicBoundaryLocation(hydraulicLocationName) - }, - 1, calculationMessageProvider); - - // Assert - Assert.IsTrue(successfulCalculation); - } - mockRepository.VerifyAll(); - } - - [Test] public void CalculateWaveHeights_NullCalculationServiceMessageProvider_ThrowsArgumentNullException() { // Setup @@ -385,28 +300,6 @@ } [Test] - public void CalculateWaveHeights_HydraulicDatabaseDoesNotExist_SuccessfulCalculationFalse() - { - // Setup - var calculatorFactory = mockRepository.StrictMock(); - var calculationMessageProvider = mockRepository.StrictMock(); - mockRepository.ReplayAll(); - - using (var viewParent = new Form()) - using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) - { - var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); - - // Call - bool successfulCalculation = guiService.CalculateWaveHeights("Does not exist", validPreprocessorDirectory, Enumerable.Empty(), 1, calculationMessageProvider); - - // Assert - Assert.IsFalse(successfulCalculation); - } - mockRepository.VerifyAll(); - } - - [Test] public void CalculateWaveHeights_ValidPathEmptyList_NoLog() { // Setup @@ -434,33 +327,6 @@ } [Test] - public void CalculateWaveHeights_ValidPathEmptyList_SuccessfulCalculationTrue() - { - // Setup - var calculatorFactory = mockRepository.StrictMock(); - var calculationMessageProvider = mockRepository.StrictMock(); - mockRepository.ReplayAll(); - - DialogBoxHandler = (name, wnd) => - { - // Expect an activity dialog which is automatically closed - }; - - using (var viewParent = new Form()) - using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) - { - var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); - - // Call - bool successfulCalculation = guiService.CalculateWaveHeights(validFilePath, validPreprocessorDirectory, Enumerable.Empty(), 1, calculationMessageProvider); - - // Assert - Assert.IsTrue(successfulCalculation); - } - mockRepository.VerifyAll(); - } - - [Test] public void CalculateWaveHeights_ValidPathOneLocationInTheList_LogsMessages() { // Setup @@ -512,44 +378,6 @@ mockRepository.VerifyAll(); } - [Test] - public void CalculateWaveHeights_ValidPathOneLocationInTheList_SuccessfulCalculationTrue() - { - // Setup - const string hydraulicLocationName = "name"; - - var calculatorFactory = mockRepository.StrictMock(); - var calculationMessageProvider = mockRepository.StrictMock(); - calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(testDataPath, validPreprocessorDirectory)).Return(new TestWaveHeightCalculator()); - calculationMessageProvider.Expect(calc => calc.GetActivityDescription(hydraulicLocationName)).Return(string.Empty); - calculationMessageProvider.Expect(calc => calc.GetCalculatedNotConvergedMessage(hydraulicLocationName)).Return(string.Empty); - mockRepository.ReplayAll(); - - DialogBoxHandler = (name, wnd) => - { - // Expect an activity dialog which is automatically closed - }; - - using (var viewParent = new Form()) - using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) - { - var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); - - // Call - bool successfulCalculation = guiService.CalculateWaveHeights(validFilePath, - validPreprocessorDirectory, - new List - { - new TestHydraulicBoundaryLocation(hydraulicLocationName) - }, - 1, calculationMessageProvider); - - // Assert - Assert.IsTrue(successfulCalculation); - } - mockRepository.VerifyAll(); - } - public override void Setup() { mockRepository = new MockRepository(); Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u -rf58cf77bdfb9cc2f44fb0ed4e7fbb3c23d4e7d8b -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision f58cf77bdfb9cc2f44fb0ed4e7fbb3c23d4e7d8b) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -522,17 +522,12 @@ double mechanismSpecificNorm = GetFailureMechanismSpecificNorm(assessmentSection, failureMechanism); - bool successfulCalculation = hydraulicBoundaryLocationCalculationGuiService.CalculateDesignWaterLevels( + hydraulicBoundaryLocationCalculationGuiService.CalculateDesignWaterLevels( assessmentSection.HydraulicBoundaryDatabase.FilePath, assessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), nodeData.WrappedData, mechanismSpecificNorm, new GrassCoverErosionOutwardsDesignWaterLevelCalculationMessageProvider()); - - if (successfulCalculation) - { - nodeData.WrappedData.NotifyObservers(); - } }); string validationText = ValidateAllDataAvailableAndGetErrorMessage(nodeData.AssessmentSection, nodeData.FailureMechanism); @@ -577,17 +572,12 @@ double mechanismSpecificNorm = GetFailureMechanismSpecificNorm(assessmentSection, failureMechanism); - bool successfulCalculation = hydraulicBoundaryLocationCalculationGuiService.CalculateWaveHeights( + hydraulicBoundaryLocationCalculationGuiService.CalculateWaveHeights( assessmentSection.HydraulicBoundaryDatabase.FilePath, assessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), nodeData.WrappedData, mechanismSpecificNorm, new GrassCoverErosionOutwardsWaveHeightCalculationMessageProvider()); - - if (successfulCalculation) - { - nodeData.WrappedData.NotifyObservers(); - } }); string validationText = ValidateAllDataAvailableAndGetErrorMessage(nodeData.AssessmentSection, nodeData.FailureMechanism); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -rc1e4cfd0fea0d560528c8d60935ce50a7243cf25 -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision c1e4cfd0fea0d560528c8d60935ce50a7243cf25) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -291,9 +291,7 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void CalculateForSelectedButton_OneSelected_CallsCalculateDesignWaterLevelsSelectionNotChanged(bool isSuccessful) + public void CalculateForSelectedButton_OneSelected_CallsCalculateDesignWaterLevelsSelectionNotChanged() { // Setup IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); @@ -307,7 +305,7 @@ HydraulicBoundaryLocation[] calculatedLocations = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, 1, null)).IgnoreArguments().WhenCalled( - invocation => { calculatedLocations = ((IEnumerable) invocation.Arguments[2]).ToArray(); }).Return(isSuccessful); + invocation => { calculatedLocations = ((IEnumerable) invocation.Arguments[2]).ToArray(); }); mockRepository.ReplayAll(); @@ -418,7 +416,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); @@ -481,7 +479,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); @@ -546,7 +544,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs =================================================================== diff -u -rc1e4cfd0fea0d560528c8d60935ce50a7243cf25 -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision c1e4cfd0fea0d560528c8d60935ce50a7243cf25) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -291,9 +291,7 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void CalculateForSelectedButton_OneSelected_CallsCalculateWaveHeightsSelectionNotChanged(bool isSuccessful) + public void CalculateForSelectedButton_OneSelected_CallsCalculateWaveHeightsSelectionNotChanged() { // Setup IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); @@ -307,7 +305,7 @@ HydraulicBoundaryLocation[] calculatedLocations = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, 1, null)).IgnoreArguments().WhenCalled( - invocation => { calculatedLocations = ((IEnumerable) invocation.Arguments[2]).ToArray(); }).Return(isSuccessful); + invocation => { calculatedLocations = ((IEnumerable) invocation.Arguments[2]).ToArray(); }); mockRepository.ReplayAll(); @@ -418,7 +416,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); @@ -480,7 +478,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); @@ -545,7 +543,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -rb4a4cd5c690555b65075132adac80b146343430f -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision b4a4cd5c690555b65075132adac80b146343430f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -1402,16 +1402,11 @@ } IAssessmentSection assessmentSection = nodeData.WrappedData; - bool successfulCalculation = hydraulicBoundaryLocationCalculationGuiService.CalculateDesignWaterLevels(assessmentSection.HydraulicBoundaryDatabase.FilePath, - assessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), - assessmentSection.HydraulicBoundaryDatabase.Locations, - assessmentSection.FailureMechanismContribution.Norm, - new DesignWaterLevelCalculationMessageProvider()); - if (successfulCalculation) - { - nodeData.NotifyObservers(); - assessmentSection.HydraulicBoundaryDatabase.NotifyObservers(); - } + hydraulicBoundaryLocationCalculationGuiService.CalculateDesignWaterLevels(assessmentSection.HydraulicBoundaryDatabase.FilePath, + assessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), + assessmentSection.HydraulicBoundaryDatabase.Locations, + assessmentSection.FailureMechanismContribution.Norm, + new DesignWaterLevelCalculationMessageProvider()); }); SetHydraulicsMenuItemEnabledStateAndTooltip(nodeData.WrappedData, designWaterLevelItem); @@ -1438,16 +1433,11 @@ return; } IAssessmentSection assessmentSection = nodeData.WrappedData; - bool successfulCalculation = hydraulicBoundaryLocationCalculationGuiService.CalculateWaveHeights(assessmentSection.HydraulicBoundaryDatabase.FilePath, - assessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), - assessmentSection.HydraulicBoundaryDatabase.Locations, - assessmentSection.FailureMechanismContribution.Norm, - new WaveHeightCalculationMessageProvider()); - if (successfulCalculation) - { - nodeData.NotifyObservers(); - assessmentSection.HydraulicBoundaryDatabase.NotifyObservers(); - } + hydraulicBoundaryLocationCalculationGuiService.CalculateWaveHeights(assessmentSection.HydraulicBoundaryDatabase.FilePath, + assessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), + assessmentSection.HydraulicBoundaryDatabase.Locations, + assessmentSection.FailureMechanismContribution.Norm, + new WaveHeightCalculationMessageProvider()); }); SetHydraulicsMenuItemEnabledStateAndTooltip(nodeData.WrappedData, waveHeightItem); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -rc1e4cfd0fea0d560528c8d60935ce50a7243cf25 -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision c1e4cfd0fea0d560528c8d60935ce50a7243cf25) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -286,9 +286,7 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void CalculateForSelectedButton_OneSelected_CallsCalculateDesignWaterLevels(bool isSuccessful) + public void CalculateForSelectedButton_OneSelected_CallsCalculateDesignWaterLevels() { // Setup var testHydraulicBoundaryDatabase = new TestHydraulicBoundaryDatabase(); @@ -302,7 +300,7 @@ IEnumerable locations = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, 1, null)).IgnoreArguments().WhenCalled( - invocation => { locations = (IEnumerable) invocation.Arguments[2]; }).Return(isSuccessful); + invocation => { locations = (IEnumerable) invocation.Arguments[2]; }); mockRepository.ReplayAll(); view.CalculationGuiService = guiService; @@ -371,7 +369,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); @@ -433,7 +431,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); @@ -494,7 +492,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -rc1e4cfd0fea0d560528c8d60935ce50a7243cf25 -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision c1e4cfd0fea0d560528c8d60935ce50a7243cf25) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -286,9 +286,7 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void CalculateForSelectedButton_OneSelected_CallsCalculateWaveHeights(bool isSuccessful) + public void CalculateForSelectedButton_OneSelected_CallsCalculateWaveHeights() { // Setup var testHydraulicBoundaryDatabase = new TestHydraulicBoundaryDatabase(); @@ -302,7 +300,7 @@ IEnumerable locations = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, 1, null)).IgnoreArguments().WhenCalled( - invocation => { locations = (IEnumerable) invocation.Arguments[2]; }).Return(isSuccessful); + invocation => { locations = (IEnumerable) invocation.Arguments[2]; }); mockRepository.ReplayAll(); view.CalculationGuiService = guiService; @@ -371,7 +369,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); @@ -433,7 +431,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); @@ -494,7 +492,7 @@ calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); normValue = (double) invocation.Arguments[3]; messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; - }).Return(true); + }); mockRepository.ReplayAll(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -rd71e7a35f747b79932dd220507568837e3ff69a1 -rdd403402744c68406685f2838f6f41e23eada5f2 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision d71e7a35f747b79932dd220507568837e3ff69a1) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision dd403402744c68406685f2838f6f41e23eada5f2) @@ -25,7 +25,6 @@ using System.Linq; using System.Threading; using System.Windows.Forms; -using Core.Common.Base; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; @@ -58,11 +57,6 @@ private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); - public override void Setup() - { - mockRepository = new MockRepository(); - } - [Test] public void Initialized_Always_ExpectedPropertiesSet() { @@ -500,14 +494,6 @@ } }; - var assessmentSectionObserver = mockRepository.StrictMock(); - assessmentSectionObserver.Expect(o => o.UpdateObserver()); - assessmentSection.Attach(assessmentSectionObserver); - - var databaseObserver = mockRepository.StrictMock(); - databaseObserver.Expect(o => o.UpdateObserver()); - assessmentSection.HydraulicBoundaryDatabase.Attach(databaseObserver); - var context = new DesignWaterLevelLocationsContext(assessmentSection); using (var treeViewControl = new TreeViewControl()) @@ -566,6 +552,11 @@ mockRepository.VerifyAll(); } + public override void Setup() + { + mockRepository = new MockRepository(); + } + private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) { return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(DesignWaterLevelLocationsContext));