コード例 #1
0
        /// <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);
        }
コード例 #2
0
 public override void Visit(TestSuiteTreeNode node)
 {
     if (node.WasExpanded && !node.IsExpanded)
     {
         node.Expand();
     }
     node.Checked = node.WasChecked;
 }
コード例 #3
0
        /// <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();
            }
        }
コード例 #4
0
 /// <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);
         }
     }
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
        /// <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);
                    }
                }
            }
        }
コード例 #7
0
        /// <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();
            }
        }
コード例 #8
0
ファイル: TestSuiteTreeView.cs プロジェクト: scottwis/eddie
        /// <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();
        }
コード例 #9
0
ファイル: TestSuiteTreeView.cs プロジェクト: scottwis/eddie
        /// <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;
        }
コード例 #10
0
 /// <summary>
 /// When Expand context menu item is clicked, expand the node
 /// </summary>
 private void expandMenuItem_Click(object sender, System.EventArgs e)
 {
     contextNode.Expand();
 }
コード例 #11
0
		/// <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);
                }
            }
		}
コード例 #12
0
ファイル: TestSuiteTreeView.cs プロジェクト: fotisp/conqat
 public override void Visit(TestSuiteTreeNode node)
 {
     if ( node.WasExpanded && !node.IsExpanded )
         node.Expand();
     node.Checked = node.WasChecked;
 }