How do I import a test case with attachment to MTLM ?

Nov 11, 2009 at 5:56 AM

Hi

I have a test case which has an attachment giving some more information. 

Using codeplex I would only be able to import test case to MTLM.

Can I also import the attachment to the test case WI's attachment tab in MTLM?

Cheers'

Jadoo

 

Nov 11, 2009 at 11:22 PM

We currently don't have any plans to implement attachment importing with the test cases. 

However, it is pretty simple to do:

            TeamFoundationServer tfs = new TeamFoundationServer("server uri");
            ITestManagementService tcm = tfs.GetService<ITestManagementService>();
            ITestManagementTeamProject project = tcm.GetTeamProject("project name");

            ITestCase testCase = project.TestCases.Find(12);
            ITestAttachment  attachment = testCase.CreateAttachment("File name");
            testCase.Attachments.Add(attachment);
            testCase.Save();