public virtual bool CheckPath(string localPath, out string reason) { lock (this.listLock) { string r = string.Empty; bool result = !string.IsNullOrEmpty(this.ignoredPaths.Find(delegate(string ignore) { bool found = localPath.StartsWith(ignore); r = found ? ignore : string.Empty; return found; })); reason = r; return result; } } }
public void AllowCorrectPaths() { var filter = new IgnoredFoldersFilter(); string reason; Assert.That(filter.CheckPath(Path.GetTempPath(), out reason), Is.False); Assert.That(string.IsNullOrEmpty(reason), Is.True); }