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()]") ); }
public void ParseTest1() { var target = new SevenZipComponent(new Soba(), new NullArchiver(), "."); Assert.Throws <SubtypeNotFoundException>(() => target.Eval("[7z NotRealSubtype.check]") ); }
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\")]") ); }
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()]") ); }
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()]") ); }