Exemple #1
0
 public void TestDirectoryExists()
 {
     Assert.True(_directoryService.CheckIfDirectoryExists(CurrentDirectory));
     Assert.False(_directoryService.CheckIfDirectoryExists(NotExistingDirectoryName));
     Assert.False(_directoryService.CheckIfDirectoryExists(string.Empty));
     Assert.False(_directoryService.CheckIfDirectoryExists(null));
 }
Exemple #2
0
 private void CreateOutputDirectoryIfNeeded(string destinationFile)
 {
     try
     {
         var outputDirectory = _pathService.GetParentDirectory(destinationFile);
         if (!_directoryService.CheckIfDirectoryExists(outputDirectory))
         {
             _directoryService.CreateDirectory(outputDirectory);
         }
     }
     catch
     {
         // ignore
     }
 }