Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelCalculationsContextTreeNodeInfoTest.cs =================================================================== diff -u -recb0e5b29e11012efd3944171530d9310e07804a -r578cc031d9dfb9c6c9e0c555d0e213c04cd52cbc --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelCalculationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelCalculationsContextTreeNodeInfoTest.cs) (revision ecb0e5b29e11012efd3944171530d9310e07804a) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelCalculationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelCalculationsContextTreeNodeInfoTest.cs) (revision 578cc031d9dfb9c6c9e0c555d0e213c04cd52cbc) @@ -262,6 +262,54 @@ } [Test] + public void ContextMenuStrip_InvalidNorm_ContextMenuItemCalculateAllDisabledAndTooltipSet() + { + // Setup + var assessmentSection = mockRepository.Stub(); + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + FilePath = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "HydraulicBoundaryDatabaseImporter"), "complete.sqlite") + }; + + assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); + + var nodeData = new DesignWaterLevelCalculationsContext(new ObservableList(), + assessmentSection, + () => 1.0, + "A"); + + using (var treeViewControl = new TreeViewControl()) + { + var gui = mockRepository.Stub(); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + mockRepository.ReplayAll(); + + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + plugin.Gui = gui; + + // Call + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) + { + // Assert + ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunAssessmentLevelCalculationsIndex]; + + Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); + StringAssert.Contains("Doelkans is te groot om een berekening uit te kunnen voeren.", contextMenuItem.ToolTipText); + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); + Assert.IsFalse(contextMenuItem.Enabled); + } + } + } + + mockRepository.VerifyAll(); // Expect no calls on arguments + } + + [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled() { // Setup