您可以使用TFS API创建测试用例。下面是来自
blog post
这充分解释了该过程。
ITestCase testCaseCore = testManagementTeamProject.TestCases.Create();
currentTestCase = new TestCase(testCaseCore, sourceTestCase.ITestSuiteBase, testPlan);
currentTestCase.ITestCase.Area = sourceTestCase.Area;
currentTestCase.ITestCase.Title = sourceTestCase.Title;
currentTestCase.ITestCase.Priority = (int)sourceTestCase.Priority;
currentTestCase.ITestCase.Actions.Clear();
currentTestCase.ITestCase.Owner = testManagementTeamProject.TfsIdentityStore.FindByTeamFoundationId(sourceTestCase.TeamFoundationId);
currentTestCase.ITestCase.Flush();
currentTestCase.ITestCase.Save();