How To: Get the Test Case associated with the unit test?
Dec 31, 2011Gautam Goenka [MSFT]
Summary
This post provides a C# code snippet demonstrating how to programmatically retrieve the test case work item associated with a unit test. It outlines the steps to connect to a TFS server and project, query for test cases using the `Microsoft.VSTS.TCM.AutomatedTestName` and `Microsoft.VSTS.TCM.AutomatedTestStorage` fields, and return the matching `ITestCase` object. This addresses a common question regarding the programmatic retrieval of test case artifacts.