public void UnzipFilesThrowsOnNullArgument() { Assert.Throws <ArgumentNullException>(() => { var _ = FileZipper.UnzipFiles(null).ToList(); }); }
public void UnizipFilesThrowsIfStreamIsEmpty() { Assert.Throws <ArgumentException>(() => { using (var stream = new MemoryStream()) { var _ = FileZipper.UnzipFiles(stream).ToList(); } }); }
public void FilesOfArchiveAreWrittenIntoMemory() { var unzippedFiles = new List <FileInfo>(); using (var archive = this.CreateArchiveFromTemporaryFiles()) { foreach (var singleFileStream in FileZipper.UnzipFiles(archive)) { using (singleFileStream) { var path = Path.GetTempFileName(); this.tempTestFiles.AddFile(path, false); File.WriteAllBytes(path, singleFileStream.ToArray()); unzippedFiles.Add(new FileInfo(path)); } } } Assert.IsTrue(unzippedFiles.All(f => f.Exists)); }