Beispiel #1
0
        public void AddNew_and_AddExisting()
        {
            var myzip = new Zip(PathToTemp("my.zip"));

            myzip.Exists.Should(Be.False);
            myzip.Paths.Should(Be.Null);

            myzip.AddNew("README", "This is the README text!");
            myzip.AddExisting("lib/foo.txt", PathToContent("moofile_examples/Moofile2"));
            myzip.AddExisting("this/is/a/deep/directory/foo.exe", PathToContent("package_working_directories/just-a-tool/tools/tool.exe"));

            myzip.Exists.Should(Be.True);
            myzip.Paths.ShouldEqual(new List <string> {
                "README", "lib/foo.txt", "this/is/a/deep/directory/foo.exe"
            });
            myzip.Read("README").ShouldEqual("This is the README text!");
            myzip.Read("lib/foo.txt").ShouldEqual("src\n\tForSource\n\nspec\n\tForSpecs1\n\tForSpecs2\n");
        }