public void stCopyDirectoryTest2() { var target = new FileComponentCopyDirectoryAccessor(); using (var tf = new TempFile(true)) { Assert.AreEqual(Value.Empty, target.parse("[File copy.directory(\"" + tf.dir + "\", \"path2\\sub1\", true, true)]")); Assert.AreEqual(true, target.cmpPaths("path2\\sub1", target.dest)); Assert.AreEqual(true, target.force); Assert.AreEqual(true, target.overwrite); Assert.AreEqual(1, target.files.Count()); Assert.AreEqual(true, target.cmpPaths(tf.file, target.files.ElementAt(0)[0])); Assert.AreEqual(Value.Empty, target.parse("[File copy.directory(\"" + tf.dir + "\", \"path2\\sub1\", true)]")); Assert.AreEqual(true, target.force); Assert.AreEqual(false, target.overwrite); } }
public void stCopyDirectoryTest3() { var target = new FileComponentCopyDirectoryAccessor(); try { target.parse("[File copy.directory(\"\", \"path2\\sub1\", false, true)]"); Assert.Fail("1"); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); } Assert.AreEqual(Value.Empty, target.parse("[File copy.directory(\"\", \"path2\\sub1\", true)]")); Assert.AreEqual(true, target.cmpPaths("path2\\sub1", target.dest)); }
public void stCopyDirectoryTest3() { var target = new FileComponentCopyDirectoryAccessor(); try { target.parse("[File copy.directory(\"\", \"path2\\sub1\", false, true)]"); Assert.Fail("1"); } catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); } Assert.AreEqual(Value.Empty, target.parse("[File copy.directory(\"\", \"path2\\sub1\", true)]")); Assert.AreEqual(true, target.cmpPaths("path2\\sub1", target.dest)); }
public void stCopyDirectoryTest2() { var target = new FileComponentCopyDirectoryAccessor(); using(var tf = new TempFile(true)) { Assert.AreEqual(Value.Empty, target.parse("[File copy.directory(\"" + tf.dir + "\", \"path2\\sub1\", true, true)]")); Assert.AreEqual(true, target.cmpPaths("path2\\sub1", target.dest)); Assert.AreEqual(true, target.force); Assert.AreEqual(true, target.overwrite); Assert.AreEqual(1, target.files.Count()); Assert.AreEqual(true, target.cmpPaths(tf.file, target.files.ElementAt(0)[0])); Assert.AreEqual(Value.Empty, target.parse("[File copy.directory(\"" + tf.dir + "\", \"path2\\sub1\", true)]")); Assert.AreEqual(true, target.force); Assert.AreEqual(false, target.overwrite); } }