Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs =================================================================== diff -u -rde4b44af0ae9ad9afa683e27b729186b234549dd -r8502754f9761fbe093af48a60e94c766973be55a --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision de4b44af0ae9ad9afa683e27b729186b234549dd) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/AssessmentSectionTreeNodeInfoTest.cs (.../AssessmentSectionTreeNodeInfoTest.cs) (revision 8502754f9761fbe093af48a60e94c766973be55a) @@ -21,10 +21,12 @@ using System.Drawing; using System.Linq; +using System.Windows.Forms; using Core.Common.Base; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; +using Core.Common.Gui.TestUtil.ContextMenu; using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; @@ -45,6 +47,7 @@ using Ringtoets.StabilityPointStructures.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; using Ringtoets.WaveImpactAsphaltCover.Forms.PresentationObjects; +using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; using RingtoetsIntegrationFormsResources = Ringtoets.Integration.Forms.Properties.Resources; namespace Ringtoets.Integration.Plugin.Test.TreeNodeInfos @@ -337,6 +340,40 @@ } [Test] + public void ContextMenuStrip_Always_ContextMenuItemImportAssessmentSectionEnabled() + { + // Setup + var section = new AssessmentSection(AssessmentSectionComposition.Dike); + using (var treeViewControl = new TreeViewControl()) + { + var gui = mocks.Stub(); + gui.Stub(g => g.Get(section, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); + gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); + mocks.ReplayAll(); + + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + plugin.Gui = gui; + + // Call + using (ContextMenuStrip contextMenu = info.ContextMenuStrip(section, section, treeViewControl)) + { + const string expectedItemText = "&Importeren..."; + const string expectedItemTooltip = "Importeer de gegevens vanuit een bestand."; + TestHelper.AssertContextMenuStripContainsItem(contextMenu, 2, + expectedItemText, expectedItemTooltip, + CoreCommonGuiResources.ImportIcon); + } + } + } + + // Assert + mocks.VerifyAll(); + } + + [Test] public void CanRename_Always_ReturnsTrue() { // Setup