Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
 private bool CopyToNonExistantDirectory(FileCopier copier)
 {
     string destPath = Path.Combine(TargetDestDir, @"newdir\another\out.txt");
     return copier.TryCopyFile(SrcFilePath, destPath);
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 4
0
 private bool CopyToDirectory(FileCopier copier)
 {
     return copier.TryCopyFile(SrcFilePath, TargetDestDir);
 }
Exemplo n.º 5
0
 private bool CopyFileToNamedTarget(FileCopier copier)
 {
     string destPath = Path.Combine(TargetDestDir, @"out.txt");
     return copier.TryCopyFile(SrcFilePath, destPath);
 }
Exemplo n.º 6
0
 public void TryCopyFile_SourceDir()
 {
     var target = new FileCopier();
     target.TryCopyFile(TargetDestDir, TargetDestDir);
 }