コード例 #1
0
        public void PackFilesTest3()
        {
            var target = new SevenZipComponentInputFilesStub();

            //TODO
            string zip = Guid.NewGuid().ToString() + ".zip";

            using (var tf = new TempFile(false)) {
                Assert.Equal(Value.Empty, target.Eval("[7z pack.files({\"" + tf.File + "\"}, \"" + zip + "\")]"));
                Assert.Equal(Value.Empty, target.Eval("[7z pack.files({\"" + tf.File + "\"}, \"" + zip + "\", SevenZip, Lzma2, 4)]"));
            }
        }
コード例 #2
0
        public void PackDirectoryTest2()
        {
            var target = new SevenZipComponentInputFilesStub();

            Assert.Throws <NotFoundException>(() =>
                                              target.Eval("[7z pack.directory(\"notrealdirfortest\", \"output\")]")
                                              );

            //TODO
            string zip = Guid.NewGuid().ToString() + ".zip";

            using (var tf = new TempFile(true)) {
                Assert.Equal(Value.Empty, target.Eval("[7z pack.directory(\"" + tf.Dir + "\", \"" + zip + "\")]"));
                Assert.Equal(Value.Empty, target.Eval("[7z pack.directory(\"" + tf.Dir + "\", \"" + zip + "\", SevenZip, Lzma2, 4)]"));
            }
        }
コード例 #3
0
        public void PackFilesTest4()
        {
            var target = new SevenZipComponentInputFilesStub();

            string zip = Guid.NewGuid().ToString() + ".zip";

            using (var tf1 = new TempFile())
                using (var tf2 = new TempFile())
                    using (var tf3 = new TempFile())
                    {
                        Assert.Equal(Value.Empty, target.Eval("[7z pack.files({\"" + tf1.File + "\", \"" + tf2.File + "\"}, \"" + zip + "\", {\"" + tf1.File + "\"})]"));
                        Assert.Single(target.Archiver.FilesInput);
                        Assert.Equal(tf2.File, target.Archiver.FilesInput[0]);

                        Assert.Equal(Value.Empty, target.Eval("[7z pack.files({\"" + tf1.File + "\", \"" + tf2.File + "\", \"" + tf3.File + "\"}, \"" + zip + "\", {\"" + tf2.File + "\"}, SevenZip, Lzma2, 4)]"));
                        Assert.Equal(2, target.Archiver.FilesInput.Count);
                        Assert.Equal(tf1.File, target.Archiver.FilesInput[0]);
                        Assert.Equal(tf3.File, target.Archiver.FilesInput[1]);
                    }
        }