Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
We have an requirement where we are using TFS & MTM SDK we need to retrieve the test suites information.
As part of the requirement I will get the test suite id and using this I should be able to retrieve corresponding parent test suites till I reach the top. My sample code is snippet is shown below
C#
ITestSuiteBase testSuite = teamProject.TestSuites.Find(suiteId);

List<TFSItem> suiteList = new List<TFSItem>();

if (testSuite != null)
{
    // this is the test plan
    if (testSuite.Parent == null)
    {
        suiteList.Add(new TFSItem(testSuite.Id.ToString(), testSuite.Title));
    }
    else
    {
        var tempSuite = testSuite;
        while (tempSuite.Parent != null)
        {
            suiteList.Add(new TFSItem(tempSuite.Id.ToString(), tempSuite.Title));
            tempSuite = tempSuite.Parent;
        }

        suiteList.Add(new TFSItem(tempSuite.Id.ToString(), tempSuite.Title));
    }
}

Here irrespective of the test suite type (dynamictestsuite or statictestsuite), the parent is always returning null.

Can anyone please let me know am I missing something here?
If there is any other alternative solution please let me know.

Thanks,
Kiran
Posted
Updated 4-Jul-12 21:11pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900