Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8377733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:44:44+00:00 2026-06-09T15:44:44+00:00

I have a TestSuite (TFS object) object which calls an add method .This add

  • 0

I have a TestSuite (TFS object) object which calls an add method .This add method accepts ITestCase as an argument .This ITestCase interface has different methods and properties described at below link:

http://msdn.microsoft.com/en-us/library/dd984690

Now i want to pass ITestCase object which implements some of those methods mentioned at above link.

   var ts = testPlan.TestSuites[i];
   var testCase = ts.TestCases.Add(<ITestCase testcase>);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:44:46+00:00Added an answer on June 9, 2026 at 3:44 pm

    Assuming that you actually want to create a real test case, as opposed to a mock in a unit test (or similar), then this blog post has a code sample which creates one: http://www.ewaldhofman.nl/post/2009/12/11/TFS-SDK-2010-e28093-Part-5-e28093-Create-a-new-Test-Case-work-item.aspx.

    Here’s some hacked-together code that creates a new test case, based on the blog entry above, and then adds it to an existing test suite (called “ExampleSuite2”, located in a test plan called “TfsVersioning Test Plan”):

    var tfsUri = new Uri("http://localhost:8080/tfs/");
    var tfsConfigServer = new TfsConfigurationServer(tfsUri, new UICredentialsProvider());
    tfsConfigServer.EnsureAuthenticated();
    
    var projCollectionNode = tfsConfigServer.CatalogNode.QueryChildren(new[] {CatalogResourceTypes.ProjectCollection}, false,                                                               CatalogQueryOptions.None).FirstOrDefault();
    var collectionId = new Guid(projCollectionNode.Resource.Properties["InstanceId"]);
    var projCollection = tfsConfigServer.GetTeamProjectCollection(collectionId);
    
    ITestManagementService tms = projCollection.GetService<ITestManagementService>();
    var project = tms.GetTeamProject("TfsVersioning");
    
    var testCase = project.TestCases.Create();
    testCase.Title = "Browse my blog";
    var navigateToSiteStep = testCase.CreateTestStep();
    navigateToSiteStep.Title = "Navigate to \"http://www.ewaldhofman.nl\"";
    testCase.Actions.Add(navigateToSiteStep);
    
    var clickOnFirstPostStep = testCase.CreateTestStep();
    clickOnFirstPostStep.Title = "Click on the first post in the summary";
    clickOnFirstPostStep.ExpectedResult = "The details of the post are visible";
    testCase.Actions.Add(clickOnFirstPostStep);
    testCase.Save();
    
    //Add test case to an existing test suite
    var plans = project.TestPlans.Query("SELECT * FROM TestPlan where PlanName = 'TfsVersioning Test Plan'");
    var plan = plans.First();
    var firstMatchingSuite = project.TestSuites.Query("SELECT * FROM TestSuite where Title = 'ExampleSuite2'").First();
    ((IStaticTestSuite)firstMatchingSuite).Entries.Add(testCase);
    plan.Save();
    

    After running this code the new test case appeared in MTM, associated with the target test suite.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this in my phpunit.xml file: <phpunit ...> <testsuites> <testsuite name=MyTests> <directory>../path/to/some/tests</directory> </testsuite>
I have a test suite DLL written in C# that uses Selenium.This is then
I have a domain name: TestSite.com. I create several subdomains for this site and
I have the following XML: <?xml version=1.0 encoding=UTF-8?> <test-report> <testsuite> <test name=RegisterConnection1Tests> <testcase name=testRregisterConnection001></testcase>
I have following, very simple, XML config for PHPUnit: <phpunit bootstrap=/_tests/TestAutoload.php> <testsuites> <testsuite name=Unit
I have some output from 3rd party software: Sample XML from the software: <testsuite
I have a simple Action class which I want to unit test: package com.gam.action.test;
We have test classes which are built on Spring 2.0.8's AbstractTransactionalDataSourceSpringContextTests. There are a
Is there a good tutorial or does anyone have experience with setting this up
In our JUnit testsuite, I have spotted a few tests that do not drive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.