Exemple #1
0
        private void updateNodeInTreeView(TestNode node)
        {
            switch (node.State)
            {
            case TestState.None:
                node.TreeNode.BackColor = Color.White;
                break;

            case TestState.Failed:
                node.TreeNode.BackColor = Color.LightSalmon;
                break;

            case TestState.Success:
                node.TreeNode.BackColor = Color.LightGreen;
                break;

            case TestState.NotImplemented:
                node.TreeNode.BackColor = Color.Yellow;
                break;
            }
        }
 public TestsTreeBuilder()
 {
     RootNode      = new TestNode();
     RootNode.Text = "_ROOT_";
 }
Exemple #3
0
 public TestRunnerGUI(TestNode rootNode)
 {
     this.rootNode = rootNode;
     TestRunner    = createTestRunner();
 }
Exemple #4
0
        private void runTestsInNode(TestNode node, ref bool resuming)
        {
            if (data.DontRerun)
            {
                resuming = false;
            }
            if (data.LastTestRunPath == null)
            {
                resuming = false;
            }
            if (node == null)
            {
                return;
            }
            if (node.IsTestMethod)
            {
                if (data.DontRerun && node.State != TestState.None)
                {
                    return;
                }
                if (resuming)
                {
                    if (node.GetPath() == data.LastTestRunPath)
                    {
                        resuming = false;
                    }

                    return;
                }

                //TODO: mainForm.treeView.SelectedNode = node.TreeNode;
                SetScopedVariablesRunning();

                data.LastTestRunPath = node.GetPath();

                //Console.WriteLine("Running Test: " + node.TestMethod.DeclaringType.FullName + "." + node.TestMethod.Name);

                node.State = TestState.Failed;
                TestRunner.Run(node.Test);
                //var testResult = runTestMethod(node.TestMethod);


                ClearScopedVariables();



                node.State = TestState.Success;



                //if (!testResult.Success)
                //if (testResult.ErrorType == typeof(NotImplementedException).FullName)
                //node.State = TestState.NotImplemented;
                //else
                //node.State = TestState.Failed;

                updateNodeInTreeView(node);
            }
            for (int i = 0; i < node.Children.Count; i++)
            {
                var c = node.Children[i];

                runTestsInNode(c, ref resuming);
            }
        }