public void CreateTest() { Task task = TaskWrapper.Create("testTask", "notepad.exe", null, null, DateTime.Now, 1); Assert.IsNotNull(task); Task found = TaskWrapper.Find("testTask"); Assert.IsNotNull(found); found.Run(); if (found.State == TaskState.Running) { found.Stop(); } TaskWrapper.Delete("testTask"); found = TaskWrapper.Find("testTask"); Assert.IsNull(found); }
public void CreateDailyTest() { Task task = TaskWrapper.CreateDaily("testDailyTask", "notepad.exe", null, null, DateTime.Now.TimeOfDay, 1); Assert.IsNotNull(task); Task found = TaskWrapper.Find("testDailyTask"); Assert.IsNotNull(found); found.Run(); if (found.State == TaskState.Running) { found.Stop(); } TaskWrapper.Delete("testDailyTask"); found = TaskWrapper.Find("testDailyTask"); Assert.IsNull(found); task = TaskWrapper.CreateDaily("test", "clear_Ids_FALCON_TH.cmd", null, Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + @"\Black & Veatch\ScheduledTasks_FALCON_TH", DateTime.Now.TimeOfDay, 1); }
public void CreateWeeklyTest() { Task task = TaskWrapper.CreateWeekly("testWeeklyTask", "notepad.exe", null, null, DateTime.Now, (int)(DaysOfTheWeek.Monday | DaysOfTheWeek.Tuesday), DateTime.Now.TimeOfDay, 1); Assert.IsNotNull(task); Task found = TaskWrapper.Find("testWeeklyTask"); Assert.IsNotNull(found); found.Run(); if (found.State == TaskState.Running) { found.Stop(); } TaskWrapper.Delete("testWeeklyTask"); found = TaskWrapper.Find("testWeeklyTask"); Assert.IsNull(found); }