Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rdfbf2e0e5fbb7cc2f3e51d55826c3772186b345b -r30fda42458cc260e4780cf68e01577204d0e41fd --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision dfbf2e0e5fbb7cc2f3e51d55826c3772186b345b) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 30fda42458cc260e4780cf68e01577204d0e41fd) @@ -437,54 +437,6 @@ } [Test] - public void GivenCalculationWithOutputAndInputInSync_WhenUpdateDikeProfileClicked_ThenNoInquiryAndCalculationNotUpdatedAndObserversNotNotified() - { - // Given - var assessmentSection = mocks.Stub(); - var dikeProfile = new TestDikeProfile(); - var calculation = new GrassCoverErosionInwardsCalculation - { - InputParameters = - { - DikeProfile = dikeProfile - }, - Output = new TestGrassCoverErosionInwardsOutput() - }; - - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); - - var inputObserver = mocks.StrictMock(); - calculation.InputParameters.Attach(inputObserver); - - var calculationObserver = mocks.StrictMock(); - calculation.Attach(calculationObserver); - - using (var treeViewControl = new TreeViewControl()) - { - var mainWindow = mocks.Stub(); - var gui = mocks.Stub(); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(g => g.MainWindow).Return(mainWindow); - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) - { - // When - menu.Items[contextMenuUpdateDikeProfileIndex].PerformClick(); - - // Then - Assert.IsTrue(calculation.HasOutput); - Assert.IsTrue(calculation.InputParameters.IsDikeProfileInputSynchronized); - - // Note: observer assertions are verified in the TearDown() - } - } - } - - [Test] public void GivenCalculationWithOutputAndInputOutOfSync_WhenUpdateDikeProfileClickedAndCancelled_ThenInquiryAndCalculationNotUpdatedAndObserversNotNotified() { // Given Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r616d3ed2e3262894d16948262fa1b223d2bc806e -r30fda42458cc260e4780cf68e01577204d0e41fd --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 616d3ed2e3262894d16948262fa1b223d2bc806e) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 30fda42458cc260e4780cf68e01577204d0e41fd) @@ -569,65 +569,6 @@ } [Test] - public void GivenCalculationWithOutputAndInputInSync_WhenUpdateEntryAndExitPointClicked_ThenNoInquiryAndCalculationNotUpdatedAndObserversNotNotified() - { - using (var treeViewControl = new TreeViewControl()) - { - // Given - var surfaceLine = new RingtoetsPipingSurfaceLine(); - surfaceLine.SetGeometry(new[] - { - new Point3D(1, 2, 3), - new Point3D(4, 5, 6) - }); - - var calculation = new PipingCalculationScenario(new GeneralPipingInput()) - { - InputParameters = - { - SurfaceLine = surfaceLine - }, - Output = new TestPipingOutput(), - SemiProbabilisticOutput = new TestPipingSemiProbabilisticOutput() - }; - - var pipingFailureMechanism = new TestPipingFailureMechanism(); - var assessmentSection = mocks.Stub(); - var nodeData = new PipingCalculationScenarioContext(calculation, - Enumerable.Empty(), - Enumerable.Empty(), - pipingFailureMechanism, - assessmentSection); - - var inputObserver = mocks.StrictMock(); - calculation.InputParameters.Attach(inputObserver); - - var calculationObserver = mocks.StrictMock(); - calculation.Attach(calculationObserver); - - var mainWindow = mocks.Stub(); - var gui = mocks.Stub(); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(g => g.MainWindow).Return(mainWindow); - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // When - contextMenuStrip.Items[contextMenuUpdateEntryAndExitPointIndex].PerformClick(); - - // Then - Assert.IsTrue(calculation.HasOutput); - Assert.IsTrue(calculation.InputParameters.IsEntryAndExitPointInputSynchronized); - - // Note: observer assertions are verified in TearDown - } - } - } - - [Test] public void GivenCalculationWithOutputAndInputOutOfSync_WhenUpdateEntryAndExitPointClickedAndCancelled_ThenInquiryAndCalculationNotUpdatedAndObserversNotNotified() { using (var treeViewControl = new TreeViewControl()) Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs =================================================================== diff -u -r907d7211601d77e3ab0d0e156b7787a9dda0490b -r30fda42458cc260e4780cf68e01577204d0e41fd --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 907d7211601d77e3ab0d0e156b7787a9dda0490b) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 30fda42458cc260e4780cf68e01577204d0e41fd) @@ -578,12 +578,12 @@ var contextMenuEnabled = true; string toolTipMessage = RingtoetsCommonFormsResources.StructuresPlugin_CreateUpdateStructureItem_Update_all_calculations_with_Structure_Tooltip; - StructuresCalculation[] calculationToUpdate = - calculations.Where(calc => calc.InputParameters.Structure != null - && !calc.InputParameters.IsStructureInputSynchronized) - .ToArray(); + StructuresCalculation[] calculationsToUpdate = calculations + .Where(calc => calc.InputParameters.Structure != null + && !calc.InputParameters.IsStructureInputSynchronized) + .ToArray(); - if (!calculationToUpdate.Any()) + if (!calculationsToUpdate.Any()) { contextMenuEnabled = false; toolTipMessage = RingtoetsCommonFormsResources.CreateUpdateContextMenuItem_No_calculations_to_update_ToolTip; @@ -592,13 +592,13 @@ return new StrictContextMenuItem(RingtoetsCommonFormsResources.StructuresPlugin_CreateUpdateStructureItem_Update_all_Structures, toolTipMessage, RingtoetsCommonFormsResources.UpdateItemIcon, - (sender, args) => UpdateStructureDependentDataOfCalculation(calculationToUpdate)) + (o, args) => UpdateStructureDependentDataOfCalculations(calculationsToUpdate)) { Enabled = contextMenuEnabled }; } - private void UpdateStructureDependentDataOfCalculation(StructuresCalculation[] calculations) + private void UpdateStructureDependentDataOfCalculations(StructuresCalculation[] calculations) { string message = RingtoetsCommonFormsResources.VerifyUpdate_Confirm_calculation_outputs_cleared; if (StructureDependentDataShouldUpdate(calculations, message))