public void SetUp() { var assembly = typeof (AssemblyPackageMarker).Assembly; var stream = assembly.GetManifestResourceStream(typeof (AssemblyPackageMarker), "pak-data.zip"); var service = new ZipFileService(); service.ExtractTo("description of this", stream, "package-data"); // These 3 files should be in the zip file embedded within the AssemblyPackage assembly File.Exists(Path.Combine("package-data", "1.txt")).ShouldBeTrue(); File.Exists(Path.Combine("package-data", "2.txt")).ShouldBeTrue(); ; File.Exists(Path.Combine("package-data", "3.txt")).ShouldBeTrue(); ; }
public void read_version_out_of_a_zip_file() { var versionFile = Path.Combine(Path.GetTempPath(), FubuMvcPackages.VersionFile); var guid = Guid.NewGuid(); new FileSystem().WriteStringToFile(versionFile, guid.ToString()); if (File.Exists("zip1.zip")) { File.Delete("zip1.zip"); } using (var zip1 = new ZipFile("zip1.zip")) { zip1.AddFile(versionFile, ""); zip1.Save(); } var service = new ZipFileService(); service.GetVersion("zip1.zip").ShouldEqual(guid); }