public void StCopyDirectoryTest2() { var target = new FileComponentCopyDirectoryStub(); using (var tf = new TempFile(true)) { Assert.Equal(Value.Empty, target.Eval("[File copy.directory(\"" + tf.Dir + "\", \"path2\\sub1\", true, true)]")); Assert.True(target.CmpPaths("path2\\sub1", target.dest)); Assert.True(target.force); Assert.True(target.overwrite); Assert.Single(target.files); Assert.True(target.CmpPaths(tf.File, target.files.ElementAt(0)[0])); Assert.Equal(Value.Empty, target.Eval("[File copy.directory(\"" + tf.Dir + "\", \"path2\\sub1\", true)]")); Assert.True(target.force); Assert.False(target.overwrite); } }
public void StCopyDirectoryTest3() { var target = new FileComponentCopyDirectoryStub(); Assert.Throws <ArgumentException>(() => target.Eval("[File copy.directory(\"\", \"path2\\sub1\", false, true)]") ); Assert.Equal(Value.Empty, target.Eval("[File copy.directory(\"\", \"path2\\sub1\", true)]")); Assert.True(target.CmpPaths("path2\\sub1", target.dest)); }