public static void TestReadWriteAccessToShare(ILogger logger, UncPath uncPath)
 {
     try
     {
         logger.LogInfo(string.Format("Trying to test unc {0}.", uncPath));
         FileCheckHelper.WriteTestFileToDirectory(logger, uncPath);
         FileCheckHelper.ReadTestFileFromDirectoryAndCompare(logger, uncPath);
         FileCheckHelper.DeleteTestFileFromDirectory(logger, uncPath);
         logger.LogInfo(string.Format("Test unc {0} succeeded.", uncPath));
     }
     catch (Exception ex)
     {
         throw new DirectoryException(string.Format("Test write and write fails on unc {0}.", uncPath), ex);
     }
 }
示例#2
0
 public static void TestReadWriteAccessToDirectory(ILogger logger, DirectoryPath directoryPath)
 {
     try
     {
         FileCheckHelper.WriteTestFileToDirectory(logger, directoryPath);
         FileCheckHelper.ReadTestFileFromDirectoryAndCompare(logger, directoryPath);
         FileCheckHelper.DeleteTestFileFromDirectory(logger, directoryPath);
     }
     catch (FileCheckException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw new DirectoryException(string.Format("Test write and write fails for directory {0}", directoryPath), ex);
     }
 }