public void unpackTest3() { var target = new SevenZipComponentExtractArchiveAccessor(); try { using (var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \" \")]")); } Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); } using (var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \"output-path\")]")); Assert.AreEqual(target.file, target.location(tf.file)); Assert.AreEqual(target.output, target.location("output-path")); Assert.AreEqual(false, target.delete); Assert.AreEqual(null, target.pwd); } using (var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \"output-path\", \"pass-123\")]")); Assert.AreEqual(target.file, target.location(tf.file)); Assert.AreEqual(target.output, target.location("output-path")); Assert.AreEqual(false, target.delete); Assert.AreEqual("pass-123", target.pwd); } using (var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \"output-path\", true)]")); Assert.AreEqual(target.file, target.location(tf.file)); Assert.AreEqual(target.output, target.location("output-path")); Assert.AreEqual(true, target.delete); Assert.AreEqual(null, target.pwd); } using (var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \"output-path\", true, \"pass-123\")]")); Assert.AreEqual(target.file, target.location(tf.file)); Assert.AreEqual(target.output, target.location("output-path")); Assert.AreEqual(true, target.delete); Assert.AreEqual("pass-123", target.pwd); } }
public void unpackTest3() { var target = new SevenZipComponentExtractArchiveAccessor(); try { using(var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \" \")]")); } Assert.Fail("1"); } catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); } using(var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \"output-path\")]")); Assert.AreEqual(target.file, target.location(tf.file)); Assert.AreEqual(target.output, target.location("output-path")); Assert.AreEqual(false, target.delete); Assert.AreEqual(null, target.pwd); } using(var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \"output-path\", \"pass-123\")]")); Assert.AreEqual(target.file, target.location(tf.file)); Assert.AreEqual(target.output, target.location("output-path")); Assert.AreEqual(false, target.delete); Assert.AreEqual("pass-123", target.pwd); } using(var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \"output-path\", true)]")); Assert.AreEqual(target.file, target.location(tf.file)); Assert.AreEqual(target.output, target.location("output-path")); Assert.AreEqual(true, target.delete); Assert.AreEqual(null, target.pwd); } using(var tf = new TempFile(false, ".zip")) { Assert.AreEqual(Value.Empty, target.parse("[7z unpack(\"" + tf.file + "\", \"output-path\", true, \"pass-123\")]")); Assert.AreEqual(target.file, target.location(tf.file)); Assert.AreEqual(target.output, target.location("output-path")); Assert.AreEqual(true, target.delete); Assert.AreEqual("pass-123", target.pwd); } }