Ejemplo n.º 1
0
        public void ShouldSerialize()
        {
            Task task1 = new Task();
            task1.Id = 1001;
            task1.MaxDuration = 1;
            task1.TaskName = "Unit Test 1001";
            task1.Executable = "cscript.exe";
            task1.Parameters = @"C:\Temp\VBScript\SleepScript.vbs";

            Task task2 = new Task();
            task2.Id = 1002;
            task2.MaxDuration = 2;
            task2.TaskName = "Unit Test 1002";
            task2.Executable = "cscript.exe";
            task2.Parameters = @"C:\Temp\VBScript\SleepScript.vbs";

            TaskGroup tg1 = new TaskGroup();
            tg1.TaskList.Add(task1);
            tg1.TaskList.Add(task2);

            XmlSerializer<TaskGroup>.Serialize(@"C:\Temp\TaskGroupTest1.xml", tg1);

            TaskGroup tg2 = XmlSerializer<TaskGroup>.Deserialize(@"C:\Temp\TaskGroupTest1.xml");
            Assert.IsTrue(tg2.TaskList.Count > 0);
        }
Ejemplo n.º 2
0
 public void ShouldRunOverMaxDuration()
 {
     Task task = new Task();
     task.Id = 1001;
     task.MaxDuration = 1;
     task.TaskName = "Unit Test - (ShouldRunOverMaxDuration)";
     task.Executable = "cscript.exe";
     task.Parameters = @"C:\Temp\VBScript\SleepScript.vbs";
     task.Run();
 }
Ejemplo n.º 3
0
        public void RunTest()
        {
            Task task1 = new Task();
            task1.Id = 1001;
            task1.MaxDuration = 1;
            task1.TaskName = "Unit Test 1001";
            task1.Executable = "cscript.exe";
            task1.Parameters = @"C:\Temp\VBScript\SleepScript.vbs";

            Task task2 = new Task();
            task2.Id = 1002;
            task2.MaxDuration = 2;
            task2.TaskName = "Unit Test 1002";
            task2.Executable = "cscript.exe";
            task2.Parameters = @"C:\Temp\VBScript\SleepScript.vbs";

            TaskGroup target = new TaskGroup();
            target.TaskList.Add(task1);
            target.TaskList.Add(task2);
            target.Run();
        }
Ejemplo n.º 4
0
 public void UpdateTask(Task task)
 {
     string[] taskArray = { task.Id.ToString(), task.TaskName, task.MaxDuration.ToString(), task.DependentIds, task.Executable, task.Parameters };
     ListViewUtil.UpdateListViewItem(m_listTaskGroup, task, taskArray);
 }
Ejemplo n.º 5
0
 public void SetTask(Task task)
 {
     m_task = task;
     BindData();
 }