Exemplo n.º 1
0
 public void Grep_FileDoesNotContainPattern_False()
 {
     using (var e = new FileTestEnvironment())
     {
         Assert.That(FileHelper.Grep(e.TempFile.Path, "lang='ee'"), Is.False);
     }
 }
Exemplo n.º 2
0
 public void Grep_FileContainsPattern_True()
 {
     using (var e = new FileTestEnvironment())
     {
         Assert.That(FileHelper.Grep(e.TempFile.Path, "lang='fr'"), Is.True);
     }
 }
Exemplo n.º 3
0
 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 '.'
     }
 }
Exemplo n.º 4
0
 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, ""));
     }
 }