private static FileFindResult getResult(string x, string searchDir, string project, FileFindResultType typeWhenDirectory) { if (x.IndexOf(Path.DirectorySeparatorChar, searchDir.Length + 1) == -1) return new FileFindResult(FileFindResultType.File, x, project); else return new FileFindResult(typeWhenDirectory, x.Substring(0, x.IndexOf(Path.DirectorySeparatorChar, searchDir.Length + 1)), project); }
private void addFile(List <FileFindResult> list, FileFindResultType type, string x, string pattern) { var start = x.ToLower().LastIndexOf(pattern); var nextDirSeparator = x.IndexOf(Path.DirectorySeparatorChar, start + pattern.Length); FileFindResult result; if (nextDirSeparator != -1) { result = new FileFindResult(FileFindResultType.Directory, x.Substring(0, nextDirSeparator)); } else { result = new FileFindResult(type, x); } if (doesNotContain(list, result)) { list.Add(result); } }
public FileFindResult(FileFindResultType type, string file, string projectPath) { Type = type; File = file; ProjectPath = projectPath; }
public FileFindResult(FileFindResultType type, string file) { Type = type; File = file; ProjectPath = null; }
public void Verify(int index, FileFindResultType type, string path, string projectPath) { Assert.That(_list[index].Type, Is.EqualTo(type)); Assert.That(_list[index].File, Is.EqualTo(path)); Assert.That(_list[index].ProjectPath, Is.EqualTo(projectPath)); }
private static FileFindResult getResult(string x, string searchDir, string project, FileFindResultType typeWhenDirectory) { if (x.IndexOf(Path.DirectorySeparatorChar, searchDir.Length + 1) == -1) { return(new FileFindResult(FileFindResultType.File, x, project)); } else { return(new FileFindResult(typeWhenDirectory, x.Substring(0, x.IndexOf(Path.DirectorySeparatorChar, searchDir.Length + 1)), project)); } }