/// <summary> /// A node has been matched with a test, so update it /// and then process child nodes and tests recursively. /// If a child was added or removed, then this node /// will expand itself. /// </summary> /// <param name="node">Node to be updated</param> /// <param name="test">Test to plug into node</param> /// <returns>True if a child node was added or deleted</returns> private bool UpdateNode(TestSuiteTreeNode node, TestNode test) { if (node.Test.TestName.FullName != test.TestName.FullName) { throw(new ArgumentException( string.Format("Attempting to update {0} with {1}", node.Test.TestName.FullName, test.TestName.FullName))); } treeMap.Remove(node.Test.TestName.UniqueName); node.Test = test; treeMap.Add(test.TestName.UniqueName, node); if (!test.IsSuite) { return(false); } bool showChildren = UpdateNodes(node.Nodes, test.Tests); if (showChildren) { node.Expand(); } return(showChildren); }
public override void Visit(TestSuiteTreeNode node) { if (node.WasExpanded && !node.IsExpanded) { node.Expand(); } node.Checked = node.WasChecked; }
/// <summary> /// When Expand context menu item is clicked, expand the node /// </summary> private void expandMenuItem_Click(object sender, System.EventArgs e) { TestSuiteTreeNode targetNode = contextNode != null ? contextNode : (TestSuiteTreeNode)SelectedNode; if (targetNode != null) { targetNode.Expand(); } }
/// <summary> /// Helper expands all fixtures under a node /// </summary> /// <param name="node">Node under which to expand fixtures</param> private void ExpandFixturesUnderNode(TestSuiteTreeNode node) { if (node.Test.IsFixture) { node.Expand(); } else { foreach (TestSuiteTreeNode child in node.Nodes) { ExpandFixturesUnderNode(child); } } }
/// <summary> /// A node has been matched with a test, so update it /// and then process child nodes and tests recursively. /// If a child was added or removed, then this node /// will expand itself. /// </summary> /// <param name="node">Node to be updated</param> /// <param name="test">Test to plug into node</param> /// <returns>True if a child node was added or deleted</returns> private bool UpdateNode(TestSuiteTreeNode node, UITestNode test) { node.UpdateTest(test); if (!test.IsSuite) { return(false); } bool showChildren = UpdateNodes(node.Nodes, test.Tests); if (showChildren) { node.Expand(); } return(showChildren); }
/// <summary> /// Helper collapses all fixtures under a node /// </summary> /// <param name="node">Node under which to collapse fixtures</param> private void HideTestsUnderNode(TestSuiteTreeNode node) { if (node.Test.IsSuite) { if (node.Test.TestType == "TestFixture") { node.Collapse(); } else { node.Expand(); foreach (TestSuiteTreeNode child in node.Nodes) { HideTestsUnderNode(child); } } } }
/// <summary> /// Helper collapses all fixtures under a node /// </summary> /// <param name="node">Node under which to collapse fixtures</param> private void HideTestsUnderNode(TestSuiteTreeNode node) { bool expand = false; foreach (TestSuiteTreeNode child in node.Nodes) { if (child.Test.IsSuite) { expand = true; HideTestsUnderNode(child); } } if (expand) { node.Expand(); } else { node.Collapse(); } }
/// <summary> /// Helper collapses all fixtures under a node /// </summary> /// <param name="node">Node under which to collapse fixtures</param> private void HideTestsUnderNode( TestSuiteTreeNode node ) { bool expand = false; foreach( TestSuiteTreeNode child in node.Nodes ) if ( child.Test.IsSuite ) { expand = true; HideTestsUnderNode( child ); } if ( expand ) node.Expand(); else node.Collapse(); }
/// <summary> /// A node has been matched with a test, so update it /// and then process child nodes and tests recursively. /// If a child was added or removed, then this node /// will expand itself. /// </summary> /// <param name="node">Node to be updated</param> /// <param name="test">Test to plug into node</param> /// <returns>True if a child node was added or deleted</returns> private bool UpdateNode( TestSuiteTreeNode node, TestNode test, IList deletedNodes ) { if ( node.Test.TestName.FullName != test.TestName.FullName ) throw( new TreeStructureChangedException( string.Format( "Attempting to update {0} with {1}", node.Test.TestName.FullName, test.TestName.FullName ) ) ); treeMap.Remove( node.Test.TestName.UniqueName ); node.Test = test; treeMap.Add( test.TestName.UniqueName, node ); if ( !test.IsSuite ) return false; bool showChildren = UpdateNodes( node.Nodes, test.Tests, deletedNodes ); if ( showChildren ) node.Expand(); return showChildren; }
/// <summary> /// When Expand context menu item is clicked, expand the node /// </summary> private void expandMenuItem_Click(object sender, System.EventArgs e) { contextNode.Expand(); }
/// <summary> /// Helper collapses all fixtures under a node /// </summary> /// <param name="node">Node under which to collapse fixtures</param> private void HideTestsUnderNode( TestSuiteTreeNode node ) { if (node.Test.IsSuite) { if (node.Test.TestType == "TestFixture") node.Collapse(); else { node.Expand(); foreach (TestSuiteTreeNode child in node.Nodes) HideTestsUnderNode(child); } } }
public override void Visit(TestSuiteTreeNode node) { if ( node.WasExpanded && !node.IsExpanded ) node.Expand(); node.Checked = node.WasChecked; }