views:

25

answers:

2

Hey,

So I'm trying to find a way in which I can insert new generic test cases into TFS through C#. These are the same ones that you can create in Visual Studio so I was hoping there was someway to do this with the TFS API somehow. Any hints of suggestions are greatly appreciated.

Thanks!!

A: 

Follow these instructions http://www.ewaldhofman.nl/post/2009/12/11/TFS-SDK-2010-e28093-Part-5-e28093-Create-a-new-Test-Case-work-item.aspx to create a new test case work item to TFS.

Ewald Hofman
Will this create a generic test case though?
tkeE2036
The goal is to have a generic test case in Visual Studo: Test->New Test...->Generic Test. Is there a way to signify the WorkItem as a generic test?
tkeE2036
I misunderstood your question. No it will not create a generic test. But the generic test is a file on the filesystem which you can add to source control. It has nothing to do with a TFS artifact. To add an item to tfs, you can use the tf checkin commandline.
Ewald Hofman
A: 

The key difference Ewald is pointing to is that there are Test Case Work Items (logical sets of tests you need to execute as a piece of recorded work) and physical tests that can verify behavior. Generic Test is a artifact that executes another tool and verifies the rseults of that other tool. It really has little direct relationship to TFS. These are things you add to a Visual Studio Test Project and can, but are not required to, place in source control (TFS or otherwise).

You can likely you can use an existing Generic Test file as your template for automating this process if you have the need.

Ryan Cromwell
Ah I didn't realize those files were just XML under the hood! Thanks. Any ideas on how to handle the "id" field so that it is unique?
tkeE2036
I really don't. You might look at to IDE automation to create the item. That's probably for another topic/tag though and definitely not one I can answer.
Ryan Cromwell