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