Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rbd73023d5f8926a411da214fb5ce522056a0e30a -rbae9328136bb33f3827192d07115f5512fa7bc32 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision bd73023d5f8926a411da214fb5ce522056a0e30a) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision bae9328136bb33f3827192d07115f5512fa7bc32) @@ -45,6 +45,8 @@ using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.HydraRing.Calculation.Calculator.Factory; +using Ringtoets.HydraRing.Calculation.TestUtil.Calculator; using Ringtoets.HydraRing.Data; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; using RingtoetsCommonServicesResources = Ringtoets.Common.Service.Properties.Resources; @@ -69,7 +71,7 @@ { mocks = new MockRepository(); guiMock = mocks.Stub(); - plugin = new ClosingStructuresPlugin() + plugin = new ClosingStructuresPlugin { Gui = guiMock }; @@ -439,7 +441,7 @@ } [Test] - public void GivenCalculationWithNonExistingLocationId_WhenCalculatingFromContextMenuFails_ThenOutputClearedLogMessagesAddedAndUpdateObserver() + public void GivenCalculationThatEndsInFailure_WhenCalculatingFromContextMenuFails_ThenOutputClearedLogMessagesAddedAndUpdateObserver() { // Given var mainWindow = mocks.Stub(); @@ -468,12 +470,12 @@ var assessmentSectionStub = mocks.Stub(); assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { Output = new ProbabilityAssessmentOutput(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN), InputParameters = { - HydraulicBoundaryLocation = hydraulicBoundaryLocation, + HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; @@ -496,7 +498,11 @@ }; using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(calculationContext, null, treeViewControl)) + using (new HydraRingCalculatorFactoryConfig()) { + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + calculator.EndInFailure = true; + // When Action action = () => contextMenuStrip.Items[contextMenuCalculateIndex].PerformClick(); @@ -546,11 +552,11 @@ var assessmentSectionStub = mocks.Stub(); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { - HydraulicBoundaryLocation = hydraulicBoundaryLocation, + HydraulicBoundaryLocation = hydraulicBoundaryLocation } };