2013-07-14 96 views
0

我試圖通過TFS API刪除特定的測試套件,現在已成功。通過TFS API刪除特定套件

IStaticTestSuite suite = suite_entry.TestSuite as IStaticTestSuite; 
if (suite != null) 
{ 
    IStaticTestSuite newSuite = destinationSuite.Project.TestSuites.CreateStatic(); 
    newSuite.Title = suite.Title; 
    destinationSuite.Entries.Add(newSuite); 
    CopyTestCases(suite, newSuite); 
    Console.WriteLine("copy Suite ID ({0}) to Id ({1})", suite.Id, newSuite.Id); 
    if (suite.SubSuites.Count > 0) 
     CopyPlanSuites(suite.Entries, newSuite); 
    if (newSuite.Entries.Count == 0) 
     newSuite.Parent.SubSuites.Remove(newSuite); 
} 
在最後一行我想刪除空套房

回答

0

找到固定它的錯誤與

destinationSuite.Entries.Remove(newSuite);