简体   繁体   中英

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.

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.

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();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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