我正在尝试通过 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);
}
在最后一行我试图删除空套房