Exemplo n.º 1
0
 public void copy_command_found_and_setted_up() {
     var x = new XElement("copy", new XAttribute("srcdir", "test"), new XAttribute("overwrite", true));
     var result = new FileSystemCommandLocator().Get(x);
     Assert.NotNull(result);
     Assert.IsInstanceOf<CopyFileSystemCommand>(result);
     var cpy = result as CopyFileSystemCommand;
     Assert.IsTrue(cpy.Overwrite);
     Assert.AreEqual("test",cpy.SrcDir);
 }
Exemplo n.º 2
0
 public void Load(XElement program) {
     this.Commands.Clear();
     this.CurrentCommandIndex = 0;
     var locator = new FileSystemCommandLocator();
     foreach (var element in program.Elements()) {
         var cmd = locator.Get(element);
         if(null==cmd) {
             Log.logerror("cannot load "+element.ToString());
             throw new Exception("cannot load " + element);
         }
         cmd.Log = this.Log;
         cmd.Filesystem = this.Filesystem;
         cmd.Programm = this;
         this.Commands.Add(cmd);
     }
 }