Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/TreeNodeInfos/StabilityPointStructureTreeNodeInfoTest.cs =================================================================== diff -u -radd325fb1e135f779adf7c89446886ff15a9b17c -r6713bc5528f2ef4327708039ccc17b1eecf7d1fe --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/TreeNodeInfos/StabilityPointStructureTreeNodeInfoTest.cs (.../StabilityPointStructureTreeNodeInfoTest.cs) (revision add325fb1e135f779adf7c89446886ff15a9b17c) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/TreeNodeInfos/StabilityPointStructureTreeNodeInfoTest.cs (.../StabilityPointStructureTreeNodeInfoTest.cs) (revision 6713bc5528f2ef4327708039ccc17b1eecf7d1fe) @@ -21,8 +21,11 @@ using System.Linq; using Core.Common.Controls.TreeView; +using Core.Common.Gui; +using Core.Common.Gui.ContextMenu; using Core.Common.TestUtil; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.StabilityPointStructures.Data; using Ringtoets.StabilityPointStructures.Data.TestUtil; using Ringtoets.StabilityPointStructures.Plugin; @@ -98,6 +101,33 @@ } } + [Test] + public void ContextMenuStrip_Always_CallsBuilderMethods() + { + // Setup + var mocksRepository = new MockRepository(); + var guiMock = mocksRepository.StrictMock(); + var menuBuilderMock = mocksRepository.StrictMock(); + + menuBuilderMock.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + mocksRepository.ReplayAll(); + + using (var plugin = new StabilityPointStructuresPlugin()) + using (var treeViewControl = new TreeViewControl()) + { + plugin.Gui = guiMock; + var info = GetInfo(plugin); + + guiMock.Expect(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + } + // Assert + mocksRepository.VerifyAll(); + } + private static TreeNodeInfo GetInfo(StabilityPointStructuresPlugin gui) { return gui.GetTreeNodeInfos().First(tni => tni.TagType == typeof(StabilityPointStructure));