//--------------------------------------------------------------------- VisibilityResults UpdateVisibility(RootCoverageTreeNode root, string filter) { var visibilityManager = new TreeNodeVisibilityManager(); visibilityManager.UpdateVisibility(root, filter); var results = new VisibilityResults(); results.Module = root.Modules.Single(); var fileTreeNodes = results.Module.Files.ToList(); results.File1 = fileTreeNodes[0]; results.File2 = fileTreeNodes[1]; return(results); }
public void RootCoverageTreeNode() { var file = new FileCoverage("file", new List <LineCoverage>()); var module = new ModuleCoverage("module"); module.AddChild(file); const int exitCode = 42; var coverage = new CoverageRate("root", exitCode); coverage.AddChild(module); var root = new RootCoverageTreeNode(coverage); root.EnsureLazyChildren(); var moduleNode = root.Modules.First(); moduleNode.EnsureLazyChildren(); var fileNode = moduleNode.Files.First(); Assert.AreEqual(coverage.Name, root.Text); Assert.AreEqual(module.Name, moduleNode.Text); Assert.AreEqual(file.Path, fileNode.Text); }