示例#1
0
        private static void Main(string[] args)
        {
            var fileCopy = new CopierFiles(@"C:\Test\xxx.txt", @"C:\Destination");
            try
            {
                fileCopy.SimpleFileCopy();
                fileCopy.CopyAllFiles();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            var allFileCopy = new CopierFiles(@"C:\Test3", @"C:\Destination");

            try
            {
                allFileCopy.CopyAllFiles();
                fileCopy.CopyFileUsingFileInfo();
                fileCopy.CopyFileUsingStream();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            var copyDirectory = new CopierDirectory(@"C:\Test2", @"C:\Destination");
            copyDirectory.CopyDirectoryRecursiv();
            copyDirectory.CopyDirectoryEasier();

            copyDirectory.CopyDirectory(@"C:\Test2", @"C:\Dest");
        }
示例#2
0
 public void CopyANonExistentDirectory()
 {
     var directoryOperator = new CopierDirectory(@"C:\Test\Abc", @"D:\Destination");
     directoryOperator.CopyDirectoryEasier();
 }
示例#3
0
 public void CopyDirectory()
 {
     var directoryOperator = new CopierDirectory(@"C:\Test\New", @"D:\Destination");
     directoryOperator.CopyDirectoryEasier();
     Assert.IsTrue(System.IO.Directory.Exists(@"D:\Destination\New"));
 }
示例#4
0
 public void CopyADirectoryWithExtension()
 {
     var directoryOperator = new CopierDirectory(@"C:\Test\A.txt", @"D:\Destination");
     directoryOperator.CopyDirectoryEasier();
     Assert.IsTrue(System.IO.Directory.Exists(@"D:\Destination\A.txt"));
 }