Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r87234360c430570d06bfa618b1b9a18a8d2b7219 -raeb548bea7572b8d55442a772ecf2d742c7168ac --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 87234360c430570d06bfa618b1b9a18a8d2b7219) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision aeb548bea7572b8d55442a772ecf2d742c7168ac) @@ -1175,7 +1175,7 @@ } [Test] - public void ContextMenuStrip_CalculationGroupWithoutCalculations_ContextMenuItemUpdateStructureAllDisabledAndToolTipSet() + public void ContextMenuStrip_CalculationGroupWithoutCalculations_ContextMenuItemUpdateDisabledAndToolTipSet() { // Setup var group = new CalculationGroup(); @@ -1206,7 +1206,7 @@ } [Test] - public void ContextMenuStrip_CalculationGroupWithCalculationsWithoutStructure_ContextMenuItemUpdateStructureAllDisabledAndToolTipSet() + public void ContextMenuStrip_CalculationGroupWithCalculationsWithoutStructure_ContextMenuItemUpdateDisabledAndToolTipSet() { // Setup var group = new CalculationGroup @@ -1243,7 +1243,7 @@ } [Test] - public void ContextMenuStrip_CalculationGroupWithCalculationWithStructureAndInputInSync_ContextMenuItemUpdateStructureAllDisabledAndToolTipSet() + public void ContextMenuStrip_CalculationGroupWithCalculationWithStructureAndInputInSync_ContextMenuItemUpdateDisabledAndToolTipSet() { // Setup var group = new CalculationGroup @@ -1286,6 +1286,51 @@ } [Test] + public void ContextMenuStrip_CalculationGroupWithCalculationWithStructureAndInputOutOfSync_ContextMenuItemUpdateEnabledAndToolTipSet() + { + // Setup + var testHeightStructure = new TestHeightStructure(); + var group = new CalculationGroup + { + Children = + { + new StructuresCalculation + { + InputParameters = + { + Structure = testHeightStructure + } + } + } + }; + + var failureMechanism = new HeightStructuresFailureMechanism(); + var assessmentSection = mocks.Stub(); + var nodeData = new HeightStructuresCalculationGroupContext(group, + failureMechanism, + assessmentSection); + + using (var treeViewControl = new TreeViewControl()) + { + guiStub.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + guiStub.Stub(g => g.MainWindow).Return(mocks.Stub()); + mocks.ReplayAll(); + + ChangeStructure(testHeightStructure); + + // Call + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) + { + // Assert + TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuUpdateStructureAllIndexRootGroup, + "&Bijwerken kunstwerken", + "Alle berekeningen met een kunstwerk bijwerken.", + RingtoetsCommonFormsResources.UpdateItemIcon); + } + } + } + + [Test] public void GivenCalculationWithStructureWithoutOutput_WhenStructureUpdatedAndUpdateClicked_ThenNoInquiryAndCalculationUpdatedAndInputObserverNotified() { // Given