예제 #1
0
        public void AddFile()
        {
            ZipFiles();

            FileProcessor sut = new FileProcessor();

            sut.AddToZip(outputZipFile, @"c:\psdata\AnExtraFile.txt");

            // Asserts omitted
        }
예제 #2
0
        public void ZipFiles()
        {
            File.Delete(outputZipFile);

            FileProcessor sut = new FileProcessor();

            sut.ZipDirectory(inputDirectory, outputZipFile);

            Assert.True(File.Exists(outputZipFile));
        }
예제 #3
0
        public void RemoveFile()
        {
            AddFile();

            FileProcessor sut = new FileProcessor();

            //無法刪除 somefiles資料夾的text1.txt
            //如果是root下的text1.txt 可以
            sut.RemoveFromZip(outputZipFile, @"AnExtraFile.txt");

            // Asserts omitted
        }
예제 #4
0
        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
        }