Corrected test code selecting a node on the main treeview.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2013-11-15 15:37:01 +00:00
parent 09e8b8ee5c
commit 4289972b1b

View File

@ -81,15 +81,15 @@ namespace XenAdminTests.TabsAndMenus
// The easiest way to generate the context menu is to call TreeView_NodeMouseClick_ ourselves.
// So construct fake click event data.
VirtualTreeNode node = FindInTree(ixmo);
Assert.IsNotNull(node, "Couldn't find a node for " + ixmoString + " in the tree");
VirtualTreeNodeMouseClickEventArgs e = new VirtualTreeNodeMouseClickEventArgs(node, MouseButtons.Right, 1, 0, 0);
Assert.IsTrue(SelectInTree(ixmo), "Couldn't find a node for " + ixmoString + " in the tree");
// Generate the TreeContextMenu
MW(() =>
{
node.EnsureVisible();
var tree = TestUtils.GetFlickerFreeTreeView(MainWindowWrapper.Item, "navigationPane.navigationView.treeView");
var e = new VirtualTreeNodeMouseClickEventArgs(tree.SelectedNode, MouseButtons.Right, 1, 0, 0);
var view = TestUtils.GetNavigationView(MainWindowWrapper.Item, "navigationPane.navigationView");
TestUtils.ExecuteMethod(view, "HandleNodeRightClick", new object[] { e });
});