简体   繁体   English

使用TFS Api,如何创建测试用例?

[英]Using TFS Api, how to create a test case?

I would like to use the TFS Api to create a test case and this test case should belong to a certain test suite obviously. 我想使用TFS Api创建一个测试用例,该测试用例显然应该属于某个测试套件。

I have found the method: 我找到了方法:

var testCase = project.TestCases.Create();

While that method seems logical, I have no idea where the test will end up being attached to the project rather than the suite. 尽管该方法似乎合乎逻辑,但我不知道测试最终将附加在项目上而不是套件上。

I'm looking for a concise example on how to create a test case using the TFS Api. 我正在寻找一个有关如何使用TFS Api创建测试用例的简洁示例。

Thank you! 谢谢!

So after some digging I found what looks like a code sample: 因此,经过一番挖掘,我发现了看起来像是代码示例的代码:

ITestCase tc = proj.TestCases.Create();
tc.Title = "Verify X when doing Y";
tc.Save();

// Now let's add that testcase
newSuite.Entries.Add(tc);

// Now let's save the plan (don't need to explicitly
// save test suites).
plan.Save();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM