public void ClearFolder()
    {
        CreateTestTasks(@"Test\SubFolder\测试任务");
        TaskSchedulerManager.ClearFolder("Test");

        try
        {
            TaskSchedulerManager.Root.GetTask(@"Test\SubFolder\测试任务");
            Assert.Fail("Expect to throw exception");
        }
        catch (IOException e)
            when(e is DirectoryNotFoundException || e is FileNotFoundException)
            {
                // Expect task is not exists.
            }
        finally
        {
            TaskSchedulerManager.Root.DeleteFolder(@"Test\SubFolder", 0);
            TaskSchedulerManager.Root.DeleteFolder(@"Test", 0);
        }
    }
Ejemplo n.º 2
0
 public void Optimize()
 {
     TaskSchedulerManager.ClearFolder(folder.Path);
 }