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("Tests"); XElement setterMethod = CreateSetterElement("Tests.FooTest", "Count"); fooSetterMethod = new CodeCoverageMethod("Tests.FooTest", setterMethod); fooSetterMethod.SequencePoints.Add(new CodeCoverageSequencePoint("c:\\Projects\\Foo\\FooTest.cs", 1, 2, 2, 3, 4, 2)); fooSetterMethod.SequencePoints.Add(new CodeCoverageSequencePoint("c:\\Projects\\Foo\\FooTest.cs", 0, 3, 4, 4, 4, 1)); XElement getterMethod = CreateGetterElement("Tests.FooTest", "Count"); fooGetterMethod = new CodeCoverageMethod("Tests.FooTest", getterMethod); fooGetterMethod.SequencePoints.Add(new CodeCoverageSequencePoint("c:\\Projects\\Foo\\FooTest.cs", 1, 1, 0, 2, 1, 1)); fooModule.Methods.Add(fooGetterMethod); fooModule.Methods.Add(fooSetterMethod); modules.Add(fooModule); using (CodeCoverageTreeView treeView = new CodeCoverageTreeView()) { treeView.AddModules(modules); fooModuleNode = (CodeCoverageModuleTreeNode)treeView.Nodes[0]; } fooModuleNode.Expanding(); fooTestsNamespaceTreeNode = (CodeCoverageNamespaceTreeNode)fooModuleNode.Nodes[0]; fooTestsNamespaceTreeNode.Expanding(); fooTestTreeNode = (CodeCoverageClassTreeNode)fooTestsNamespaceTreeNode.Nodes[0]; fooTestTreeNode.Expanding(); if (fooTestTreeNode.Nodes.Count > 0) { countPropertyTreeNode = fooTestTreeNode.Nodes[0] as CodeCoveragePropertyTreeNode; } countPropertyTreeNode.Expanding(); if (countPropertyTreeNode != null && countPropertyTreeNode.Nodes.Count > 1) { fooGetterTreeNode = (CodeCoverageMethodTreeNode)countPropertyTreeNode.Nodes[0]; fooSetterTreeNode = (CodeCoverageMethodTreeNode)countPropertyTreeNode.Nodes[1]; } }
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]; }