0

I think the TFS API has a bug in it, here I'll try and demonstrate:

Using a team project object like this:

ITestManagementTeamProject project

I can get direct access to the test case like this:

var testCase = project.TestCases.Find(testCaseId);

If the test case is accessed in this way then:

testCase.ParentTestSuite // will always be null

BUT

If I access the test case from the test suite like this:

var testSuite = project.TestSuites.Find(testSuiteId);

         foreach (var test in testSuite.TestCases)
         {
            var check = test.ParentTestSuite; // ParentTestSuite is populated
         }

Is it just me, or is there a bug here?

EDIT: For clarification in both cases the same objects are being used and returned.

JL.
  • 78,954
  • 126
  • 311
  • 459
  • Seem like is lazy loading the properties asociated to the object.. – Oscar Jun 25 '14 at 09:18
  • If it is lazy loading is there a way to force it to load without having to traverse the collection? – JL. Jun 25 '14 at 10:40
  • If you think this is a bug please vote here: https://connect.microsoft.com/VisualStudio/feedback/details/905522/test-case-parent-suite-is-null-when-loading-from-testcases-find-method – JL. Jun 25 '14 at 10:44

0 Answers0