Пример #1
0
 public void OpenNonExistantStream(string appendix)
 {
     using (var cleaner = new TestFileCleaner(useDotNet: false))
     {
         string filePath = cleaner.GetTestPath() + appendix;
         Action action   = () => cleaner.FileService.CreateFileStream(filePath, FileMode.Open);
         action.ShouldThrow <FileNotFoundException>();
     }
 }
Пример #2
0
 public void FileInfoHasCanonicalPaths()
 {
     using (var cleaner = new TestFileCleaner(useDotNet: false))
     {
         string filePath = cleaner.GetTestPath() + "UPPER";
         cleaner.FileService.WriteAllText(filePath, "FileInfoHasCanonicalPaths");
         var info = cleaner.FileService.GetPathInfo(filePath.ToLowerInvariant());
         info.Path.Should().Be(filePath);
     }
 }
Пример #3
0
 public void FileInfoHasCanonicalPaths()
 {
     using (var cleaner = new TestFileCleaner(useDotNet: false))
     {
         string filePath = cleaner.GetTestPath() + "UPPER";
         cleaner.FileService.WriteAllText(filePath, "FileInfoHasCanonicalPaths");
         var info = cleaner.FileService.GetPathInfo(filePath.ToLowerInvariant());
         info.Path.Should().Be(filePath);
     }
 }
Пример #4
0
 public void OpenNonExistantStream(string appendix)
 {
     using (var cleaner = new TestFileCleaner(useDotNet: false))
     {
         string filePath = cleaner.GetTestPath() + appendix;
         Action action = () => cleaner.FileService.CreateFileStream(filePath, FileMode.Open);
         action.ShouldThrow<FileNotFoundException>();
     }
 }