Index: Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs =================================================================== diff -u -rcab149df8817619bf57306592cfeb6dafaacdacf -r8fd671772d79c2e55c72f7acd2e22725348f4176 --- Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs (.../GuiContextMenuItemFactoryTest.cs) (revision cab149df8817619bf57306592cfeb6dafaacdacf) +++ Core/Common/test/Core.Common.Gui.Test/ContextMenu/GuiContextMenuItemFactoryTest.cs (.../GuiContextMenuItemFactoryTest.cs) (revision 8fd671772d79c2e55c72f7acd2e22725348f4176) @@ -715,10 +715,6 @@ var viewCommands = mocks.StrictMock(); var nodeData = new object(); commandHandler.Expect(ch => ch.CanShowPropertiesFor(nodeData)).Return(hasPropertyInfoForNodeData); - if (hasPropertyInfoForNodeData) - { - commandHandler.Expect(ch => ch.ShowPropertiesForSelection()); - } var contextMenuFactory = new GuiContextMenuItemFactory(commandHandler, importCommandHandler, @@ -731,7 +727,6 @@ // Call ToolStripItem item = contextMenuFactory.CreatePropertiesItem(); - item.PerformClick(); // Assert Assert.AreEqual(Resources.Properties, item.Text); @@ -741,5 +736,37 @@ mocks.VerifyAll(); } + + [Test] + public void CreatePropertiesItem_CanShowPropertiesFor_CausesPropertiesToBeShownWhenClicked() + { + // Setup + var commandHandler = mocks.StrictMock(); + var importCommandHandler = mocks.StrictMock(); + var exportCommandHandler = mocks.StrictMock(); + var updateCommandHandler = mocks.StrictMock(); + var viewCommands = mocks.StrictMock(); + var nodeData = new object(); + + commandHandler.Expect(ch => ch.CanShowPropertiesFor(nodeData)).Return(true); + commandHandler.Expect(ch => ch.ShowPropertiesForSelection()); + + var contextMenuFactory = new GuiContextMenuItemFactory(commandHandler, + importCommandHandler, + exportCommandHandler, + updateCommandHandler, + viewCommands, + nodeData); + + mocks.ReplayAll(); + + ToolStripItem item = contextMenuFactory.CreatePropertiesItem(); + + // Call + item.PerformClick(); + + // Assert + mocks.VerifyAll(); + } } } \ No newline at end of file