Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static List<TestCase> GetAllTestCasesInTestPlan(ITestManagementTeamProject testManagementTeamProject, ITestPlan testPlan, bool initializeTestCaseStatus = true)
- {
- testPlan.Refresh();
- List<TestCase> testCasesList;
- testCasesList = new List<TestCase>();
- string fullQuery =
- String.Format("SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.WorkItemType] = 'Test Case' AND [Team Project] = '{0}'", testManagementTeamProject.TeamProjectName);
- IEnumerable<ITestCase> allTestCases = testManagementTeamProject.TestCases.Query(fullQuery);
- foreach (var currentTestCase in allTestCases)
- {
- TestCase testCaseToAdd = new TestCase(currentTestCase, currentTestCase.TestSuiteEntry.ParentTestSuite, testPlan, initializeTestCaseStatus);
- if (!testCasesList.Contains(testCaseToAdd))
- {
- testCasesList.Add(testCaseToAdd);
- }
- }
- return testCasesList;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement