예제 #1
0
        public void Should_return_the_zip_if_a_root_item_is_asked_for_its_parent()
        {
            var result3 = ZippedPath.GetParentPath("noexist.zip\\test");

            Assert.AreEqual("noexist.zip", result3);


            var result4 = ZippedPath.GetParentPath("noexist.zip\\yo.txt");

            Assert.AreEqual("noexist.zip", result4);
        }
예제 #2
0
        protected override void Execute(CodeActivityContext context)
        {
            var SourceFilePath     = FolderPath.Get(context);
            var DistinationZipPath = ZippedPath.Get(context);
            var Password_Val       = Password.Get(context);

            using (ZipFile zip = new ZipFile())
            {
                zip.Password = Password_Val.ToString();
                zip.AddDirectory(SourceFilePath);
                zip.Save(DistinationZipPath);
            }
        }
예제 #3
0
        public void Should_get_the_parent_folder_of_the_folder()
        {
            var result2 = ZippedPath.GetParentPath("noexist.zip\\test\\test2");

            Assert.AreEqual("test", result2);
        }
예제 #4
0
        public void Should_get_the_parent_folder_of_the_file()
        {
            var result = ZippedPath.GetParentPath("noexist.zip\\lib\\yo.txt");

            Assert.AreEqual("lib", result);
        }
예제 #5
0
        public void Should_get_the_name_of_the_zip_file()
        {
            var result = ZippedPath.GetZip("noexist.zip\\lib\\yo.txt");

            Assert.AreEqual("noexist.zip", result);
        }
예제 #6
0
        public void Should_convert_the_path_to_a_zip_path()
        {
            var result = ZippedPath.GetPathInsideZip("noexist.zip\\lib\\yo.txt");

            Assert.AreEqual("lib/yo.txt", result);
        }