public void Grep_FileDoesNotContainPattern_False() { using (var e = new FileTestEnvironment()) { Assert.That(FileHelper.Grep(e.TempFile.Path, "lang='ee'"), Is.False); } }
public void Grep_FileContainsPattern_True() { using (var e = new FileTestEnvironment()) { Assert.That(FileHelper.Grep(e.TempFile.Path, "lang='fr'"), Is.True); } }
public void CheckValidPathname_AcceptsMatchedExtensions() { using (var e = new FileTestEnvironment()) { Assert.True(PathHelper.CheckValidPathname(e.TempFile.Path, Path.GetExtension(e.TempFile.Path))); // With starting '.' Assert.True(PathHelper.CheckValidPathname(e.TempFile.Path, Path.GetExtension(e.TempFile.Path).Substring(1))); // Sans starting '.' } }
public void CheckValidPathname_RejectsMismatchedExtension() { using (var e = new FileTestEnvironment()) { Assert.IsFalse(PathHelper.CheckValidPathname(e.TempFile.Path, "xyz")); Assert.IsFalse(PathHelper.CheckValidPathname(e.TempFile.Path, null)); Assert.IsFalse(PathHelper.CheckValidPathname(e.TempFile.Path, "")); } }