Exemple #1
0
        private bool CopyToReadOnlyFile(FileCopier copier)
        {
            if (File.Exists(ReadOnlyDestTxtPath))
            {
                FileInfo info = new FileInfo(ReadOnlyDestTxtPath);

                // ensure that the file is readonly.
                if (!info.IsReadOnly)
                {
                    info.IsReadOnly = true;
                }

                return copier.TryCopyFile(SrcFilePath, ReadOnlyDestTxtPath);
            }
            else
            {
                Assert.Fail("The data for this test case has not been properly deployed! Missing file: " + ReadOnlyDestTxtPath);
                return false;
            }
        }
Exemple #2
0
 private bool CopyToNonExistantDirectory(FileCopier copier)
 {
     string destPath = Path.Combine(TargetDestDir, @"newdir\another\out.txt");
     return copier.TryCopyFile(SrcFilePath, destPath);
 }
Exemple #3
0
 private bool CopyToExistingFile(FileCopier copier)
 {
     if (File.Exists(ExistingDestTxtPath))
     {
         return copier.TryCopyFile(SrcFilePath, ExistingDestTxtPath);
     }
     else
     {
         Assert.Fail("The data for this test case has not been properly deployed! Missing file: " + ExistingDestTxtPath);
         return false;
     }
 }
Exemple #4
0
 private bool CopyToDirectory(FileCopier copier)
 {
     return copier.TryCopyFile(SrcFilePath, TargetDestDir);
 }
Exemple #5
0
 private bool CopyFileToNamedTarget(FileCopier copier)
 {
     string destPath = Path.Combine(TargetDestDir, @"out.txt");
     return copier.TryCopyFile(SrcFilePath, destPath);
 }
Exemple #6
0
 public void TryCopyFile_SourceDir()
 {
     var target = new FileCopier();
     target.TryCopyFile(TargetDestDir, TargetDestDir);
 }