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"); }
public void CopyAllFileFromADirectory() { var fileOperator = new CopierFiles(@"C:\Test\New", @"D:\Destination"); fileOperator.CopyAllFiles(); Assert.IsTrue(System.IO.File.Exists(@"D:\Destination\aaa.txt")); Assert.IsTrue(System.IO.File.Exists(@"D:\Destination\test.txt")); }
public void WhenICopyInToFolder(string dest) { this.file = new CopierFiles(source, dest); this.file.SimpleFileCopy(); }
public void WhenICopyAllTheFileInToFolder(string dest) { this.file = new CopierFiles(source, dest); this.file.CopyAllFiles(); }
public void WhenTryToCopyANonExistentFileSouldThrownAnException() { var fileOperation = new CopierFiles(@"C:\Test\text.txt", @"C:\Destination"); fileOperation.SimpleFileCopy(); }
public void TryToCopyFileWhenThwSourceIsADirectoryInsteadOfFile() { var fileOperator = new CopierFiles(@"C:\Test\New", @"D:\Destination"); fileOperator.CopyFileUsingFileInfo(); }
public void TryCopyAllFileWhenTheSourcePathIsAFile() { var fileOperator = new CopierFiles(@"C:\Test\test.txt", @"D:\Destination"); fileOperator.CopyAllFiles(); }
public void SingleFileCopy() { var fileOperation = new CopierFiles(@"C:\Test\test.txt", @"C:\Destination"); fileOperation.SimpleFileCopy(); Assert.IsTrue(System.IO.File.Exists(@"C:\Destination\test.txt")); }
public void CopyFileWithoutExtension() { var fileOperator = new CopierFiles(@"C:\Test\bbb", @"D:\Destination"); fileOperator.CopyFileUsingFileInfo(); Assert.IsTrue(System.IO.File.Exists(@"D:\Destination\bbb")); }
public void CopyFileUsingStreamReadAndWrite() { var fileOperator = new CopierFiles(@"C:\Test\ceva.txt", @"D:\Destination"); fileOperator.CopyFileUsingStream(); Assert.IsTrue(System.IO.File.Exists(@"D:\Destination\ceva.txt")); }