Beispiel #1
0
        public void Init()
        {
            CodeCoverageMethod method = new CodeCoverageMethod("FileElementHasAttributeNamedType", "AbstractElementSchemaTestFixture");

            module = new CodeCoverageModule("XmlEditor.Tests");
            module.Methods.Add(method);
            List <CodeCoverageModule> modules = new List <CodeCoverageModule>();

            modules.Add(module);

            TreeNodeCollection nodes;

            using (CodeCoverageTreeView treeView = new CodeCoverageTreeView()) {
                treeView.AddModules(modules);
                nodes = treeView.Nodes;
            }

            CodeCoverageModuleTreeNode moduleNode = (CodeCoverageModuleTreeNode)nodes[0];

            moduleNode.Expanding();
            CodeCoverageClassTreeNode classNode = (CodeCoverageClassTreeNode)moduleNode.Nodes[0];

            classNode.Expanding();
            methodNode = (CodeCoverageMethodTreeNode)classNode.Nodes[0];
        }
        public void Init()
        {
            List <CodeCoverageModule> modules       = new List <CodeCoverageModule>();
            CodeCoverageModule        fooModule     = new CodeCoverageModule("Foo.Tests");
            CodeCoverageMethod        fooTestMethod = new CodeCoverageMethod("FooTest", "Foo.Tests.FooTestFixture");

            fooTestMethod.SequencePoints.Add(new CodeCoverageSequencePoint("c:\\Projects\\Foo\\FooTestFixture.cs", 0, 1, 0, 2, 1, 1));
            fooTestMethod.SequencePoints.Add(new CodeCoverageSequencePoint("c:\\Projects\\Foo\\FooTestFixture.cs", 0, 2, 2, 3, 4, 1));

            fooModule.Methods.Add(fooTestMethod);

            modules.Add(fooModule);

            using (CodeCoverageTreeView treeView = new CodeCoverageTreeView()) {
                treeView.AddModules(modules);
                nodes = treeView.Nodes;
            }

            fooModuleNode = (CodeCoverageModuleTreeNode)nodes[0];

            fooModuleNode.Expanding();
            fooNamespaceTreeNode = (CodeCoverageNamespaceTreeNode)fooModuleNode.Nodes[0];

            fooNamespaceTreeNode.Expanding();
            fooTestsNamespaceTreeNode = (CodeCoverageNamespaceTreeNode)fooNamespaceTreeNode.Nodes[0];

            fooTestsNamespaceTreeNode.Expanding();
            fooTestFixtureTreeNode = (CodeCoverageClassTreeNode)fooTestsNamespaceTreeNode.Nodes[0];

            fooTestFixtureTreeNode.Expanding();
            fooTestMethodTreeNode = (CodeCoverageMethodTreeNode)fooTestFixtureTreeNode.Nodes[0];
        }
        public void SetUpFixture()
        {
            List <CodeCoverageModule> modules        = new List <CodeCoverageModule>();
            CodeCoverageModule        fooModule      = new CodeCoverageModule("Foo.Tests");
            CodeCoverageMethod        fooTestMethod1 = new CodeCoverageMethod("FooTest1", "Foo.Tests.FooTestFixture");

            fooTestMethod1.SequencePoints.Add(new CodeCoverageSequencePoint("c:\\Projects\\Foo\\FooTestFixture.cs", 1, 1, 0, 2, 1));
            fooTestMethod1.SequencePoints.Add(new CodeCoverageSequencePoint("c:\\Projects\\Foo\\FooTestFixture.cs", 0, 2, 2, 3, 4));
            CodeCoverageMethod fooTestMethod2 = new CodeCoverageMethod("FooTest2", "Foo.Tests.FooTestFixture");
            CodeCoverageMethod helperMethod   = new CodeCoverageMethod("GetCoverageFile", "Foo.Tests.Util.Helper");

            fooModule.Methods.Add(fooTestMethod1);
            fooModule.Methods.Add(fooTestMethod2);
            fooModule.Methods.Add(helperMethod);

            CodeCoverageModule barModule = new CodeCoverageModule("Bar.Tests");

            modules.Add(barModule);
            modules.Add(fooModule);

            using (CodeCoverageTreeView treeView = new CodeCoverageTreeView()) {
                treeView.AddModules(modules);
                nodes = treeView.Nodes;
            }

            barModuleNode = (CodeCoverageModuleTreeNode)nodes[0];
            fooModuleNode = (CodeCoverageModuleTreeNode)nodes[1];

            fooModuleNode.Expanding();
            fooNamespaceTreeNode = (CodeCoverageNamespaceTreeNode)fooModuleNode.Nodes[0];

            fooNamespaceTreeNode.Expanding();
            fooTestsNamespaceTreeNode = (CodeCoverageNamespaceTreeNode)fooNamespaceTreeNode.Nodes[0];

            fooTestsNamespaceTreeNode.Expanding();
            fooTestsUtilNamespaceTreeNode = (CodeCoverageNamespaceTreeNode)fooTestsNamespaceTreeNode.Nodes[0];
            fooTestFixtureTreeNode        = (CodeCoverageClassTreeNode)fooTestsNamespaceTreeNode.Nodes[1];

            fooTestFixtureTreeNode.Expanding();
            fooTestMethod1TreeNode = (CodeCoverageMethodTreeNode)fooTestFixtureTreeNode.Nodes[0];
            fooTestMethod2TreeNode = (CodeCoverageMethodTreeNode)fooTestFixtureTreeNode.Nodes[1];
        }