Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentTreeNodeInfoTest.cs =================================================================== diff -u -rf67372a878749b45946b74d08f75f3da3f673a40 -recec25857ea074a9f85c55050a6e4f8520212a34 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentTreeNodeInfoTest.cs (.../AssessmentSectionCommentTreeNodeInfoTest.cs) (revision f67372a878749b45946b74d08f75f3da3f673a40) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/AssessmentSectionCommentTreeNodeInfoTest.cs (.../AssessmentSectionCommentTreeNodeInfoTest.cs) (revision ecec25857ea074a9f85c55050a6e4f8520212a34) @@ -23,8 +23,11 @@ using System.Linq; using System.Runtime.Remoting; 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.Common.Data; using Ringtoets.Integration.Plugin; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -108,5 +111,30 @@ // Assert Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color); } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var mocks = new MockRepository(); + var gui = mocks.StrictMultiMock(); + var treeViewControl = mocks.StrictMock(); + var menuBuilderMock = mocks.StrictMock(); + + gui.Expect(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + + menuBuilderMock.Expect(mb => mb.AddOpenItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + + mocks.ReplayAll(); + + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + + // Assert + mocks.VerifyAll(); + } } }