Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismContributionContextTreeNodeInfoTest.cs =================================================================== diff -u -r3abef5ccb0ba5386c65d4156b319970fc4337a29 -r4e6c8ac0eb663ddfe4565745fb4829a8432019e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismContributionContextTreeNodeInfoTest.cs (.../FailureMechanismContributionContextTreeNodeInfoTest.cs) (revision 3abef5ccb0ba5386c65d4156b319970fc4337a29) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismContributionContextTreeNodeInfoTest.cs (.../FailureMechanismContributionContextTreeNodeInfoTest.cs) (revision 4e6c8ac0eb663ddfe4565745fb4829a8432019e2) @@ -115,7 +115,6 @@ var assessmentSection = mocks.Stub(); var context = new FailureMechanismContributionContext(contribution, assessmentSection); - var treeViewControlMock = mocks.StrictMock(); var menuBuilderMock = mocks.StrictMock(); menuBuilderMock.Expect(mb => mb.AddOpenItem()).Return(menuBuilderMock); @@ -124,20 +123,23 @@ menuBuilderMock.Expect(mb => mb.Build()).Return(null); var gui = mocks.StrictMock(); - gui.Expect(cmp => cmp.Get(context, treeViewControlMock)).Return(menuBuilderMock); gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); - mocks.ReplayAll(); - - using (var plugin = new RingtoetsGuiPlugin()) + using (var treeViewControl = new TreeViewControl()) { - var info = GetInfo(plugin); + gui.Expect(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilderMock); + mocks.ReplayAll(); - plugin.Gui = gui; + using (var plugin = new RingtoetsGuiPlugin()) + { + var info = GetInfo(plugin); - // Call - info.ContextMenuStrip(context, null, treeViewControlMock); + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(context, null, treeViewControl); + } } // Assert mocks.VerifyAll();