我想使用Microsoft Test Manager API将测试用例附加到测试计划中。
public override void PostTestCase(TestCase testCase) {
ITestPlanCollection plans = testTeamProject.TestPlans.Query("Select * From TestPlan");
List<ITestStep> testStepList = new List<ITestStep>();
ITestCase tc = testTeamProject.TestCases.Create();
tc.Title = "MTM Test";
ITestActionGroup group = tc.CreateTestActionGroup();
group.Name = "Test Case Group";
for (int i = 0; i < testCase.steps.Count; i++) {
testStepList.Add(tc.CreateTestStep());
testStepList[i].Title = testCase.steps[i].description;
}
foreach (var item in testStepList as IEnumerable<ITestStep>) {
group.Actions.Add(item);
}
tc.Actions.Add(group);
tc.Save();
}
我可以使用下面的代码块创建一个新的测试用例。但是,它似乎与测试计划没有联系。