private void MatchFiles(String path, List <FileInfo> unitTestsList, List <FileInfo> codeFileList) { fileDir = new FilePairDirectory(path); foreach (FileInfo codeFile in codeFileList) { FilePair filePair = new FilePair(); filePair.codeFile = codeFile; foreach (FileInfo testFile in unitTestsList) { if (testFile.Name.Equals(codeFile.Name)) { filePair.unitTestFile = testFile; break; } } RunTest(filePair); fileDir.Add(filePair); } foreach (FileInfo testFile in unitTestsList) { FilePair filePair = new FilePair(); filePair.unitTestFile = testFile; RunTest(filePair); fileDir.Add(filePair); } }
public void Add(FilePair pair) { FileInfo file = pair.codeFile; if (file == null) { file = pair.unitTestFile; } String remainingPath = file.FullName.Remove(0, _path.Length + 1); if (remainingPath.Contains("\\")) { String subDirPath = file.FullName.Remove(_path.Length + 1 + remainingPath.IndexOf("\\")); if (!dirs.ContainsKey(subDirPath)) { dirs[subDirPath] = new FilePairDirectory(subDirPath); } dirs[subDirPath].Add(pair); } else { files.Add(pair); } }
public TreeNode UpdateTreeNode(FilePairDirectory dir) { TreeNode node = new TreeNode(); node.Text = dir.Name; foreach (FilePair filePair in dir.files) { node.Nodes.Add(GetUnitTestInfo(filePair)); } return(node); }
public void UpdateTreeNodeCollection(TreeNodeCollection col, FilePairDirectory dir) { col.Clear(); foreach (KeyValuePair <String, FilePairDirectory> pair in dir.dirs) { FilePairDirectory subDir = pair.Value; col.Add(UpdateTreeNode(subDir)); } foreach (FilePair filePair in dir.files) { col.Add(GetUnitTestInfo(filePair)); } }