예제 #1
0
        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));
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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));
        }
예제 #4
0
        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);
            }
        }