0

I'm trying to delete a specific test suite through TFS API with now success.

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);
}

in the last line I'm trying to delete empty suites

rene
  • 41,474
  • 78
  • 114
  • 152
ekrako
  • 169
  • 1
  • 11

1 Answers1

0

found the error fixed it with

destinationSuite.Entries.Remove(newSuite);
ekrako
  • 169
  • 1
  • 11