Ejemplo n.º 1
0
        public void CheckTest1()
        {
            var target = new SevenZipComponent(new Soba(), new NullArchiver(), "");

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[7z check]")
                                                   );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[7z check()]")
                                             );
        }
Ejemplo n.º 2
0
        public void ParseTest1()
        {
            var target = new SevenZipComponent(new Soba(), new NullArchiver(), ".");

            Assert.Throws <SubtypeNotFoundException>(() =>
                                                     target.Eval("[7z NotRealSubtype.check]")
                                                     );
        }
Ejemplo n.º 3
0
        public void PackFilesTest2()
        {
            var target = new SevenZipComponent(new Soba(), new NullArchiver(), ".");

            Assert.Throws <PMArgException>(() =>
                                           target.Eval("[7z pack.files({}, \"output\")]")
                                           );

            using (var tf = new TempFile())
            {
                Assert.Throws <ArgumentException>(() =>
                                                  target.Eval("[7z pack.files({\"" + tf.File + "\", \" \"}, \"output\")]")
                                                  );

                Assert.Throws <ArgumentException>(() =>
                                                  target.Eval("[7z pack.files({\" \", \"" + tf.File + "\"}, \"output\")]")
                                                  );

                Assert.Throws <ArgumentException>(() =>
                                                  target.Eval("[7z pack.files({\"" + tf.File + "\"}, \" \")]")
                                                  );
            }

            Assert.Throws <NotFoundException>(() =>
                                              target.Eval("[7z pack.files({\"thisisreallyisnotreal.file\", \" \"}, \"output\")]")
                                              );

            Assert.Throws <ArgumentException>(() =>
                                              target.Eval("[7z pack.files({\" \"}, \"output\")]")
                                              );
        }
Ejemplo n.º 4
0
        public void PackDirectoryTest1()
        {
            var target = new SevenZipComponent(new Soba(), new NullArchiver(), ".");

            Assert.Throws <ArgumentException>(() =>
                                              target.Eval("[7z pack.directory(\" \", \"name.zip\")]")
                                              );

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

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[7z pack.directory(\"dir\")]")
                                             );

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

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

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[7z pack.directory()]")
                                             );
        }
Ejemplo n.º 5
0
        public void PackFilesTest1()
        {
            var target = new SevenZipComponent(new Soba(), new NullArchiver(), ".");

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

            Assert.Throws <PMArgException>(() =>
                                           target.Eval("[7z pack.files({\"f1\", 12}, \"output\")]")
                                           );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[7z pack.files({\"f1\", \"f2\"}, \"output\", SevenZip)]")
                                             );

            Assert.Throws <NotSupportedOperationException>(() =>
                                                           target.Eval("[7z pack.files({\"f1\"}, \"output\").right]")
                                                           );

            Assert.Throws <PMLevelException>(() =>
                                             target.Eval("[7z pack.files()]")
                                             );
        }