如何将测试用例添加到测试计划MTM Web API中?

时间:2018-11-28 10:18:37

标签: microsoft-test-manager

我想使用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();
        }

我可以使用下面的代码块创建一个新的测试用例。但是,它似乎与测试计划没有联系。

Test case should be added under these folder structure

0 个答案:

没有答案