public void AddFile() { ZipFiles(); FileProcessor sut = new FileProcessor(); sut.AddToZip(outputZipFile, @"c:\psdata\AnExtraFile.txt"); // Asserts omitted }
public void ZipFiles() { File.Delete(outputZipFile); FileProcessor sut = new FileProcessor(); sut.ZipDirectory(inputDirectory, outputZipFile); Assert.True(File.Exists(outputZipFile)); }
public void RemoveFile() { AddFile(); FileProcessor sut = new FileProcessor(); //無法刪除 somefiles資料夾的text1.txt //如果是root下的text1.txt 可以 sut.RemoveFromZip(outputZipFile, @"AnExtraFile.txt"); // Asserts omitted }
public void UnzipFiles() { ZipFiles(); string unzipDestinationDir = Path.Combine(inputDirectory, @"..\unzip"); unzipDestinationDir = Path.GetFullPath(unzipDestinationDir); if (Directory.Exists(unzipDestinationDir)) { Directory.Delete(unzipDestinationDir, true); } FileProcessor sut = new FileProcessor(); sut.UnZip(outputZipFile, unzipDestinationDir); // Asserts omitted }