Team Foundation Service
  •  
  • Sign In
  • Home
  • Pricing
  • Learn
  • Community
  • Support
  • Account
  • Start
  • code
  • build
  • test
  • Collaborate
Sign up for free

Choose your product:

  • Connect to TFS
  • Upload your code
  • Check files in and out
  • Get your code reviewed
  • Create a unit test
  • Run unit tests
  • Run unit tests automatically with local builds
  • Use other unit test frameworks
  • Connect to TFS
  • Share your code
  • Check files in and out
  • Use Git and Eclipse with TFS
  • Use Git and Xcode with TFS
  • Create a new code project
  • Write and commit your code
  • Publish your code into TFS
  • Clone to your dev machine
  • Pull changes from the team
  • Push your changes

Create a unit test

Create unit tests to make sure your code works properly, and to keep it working properly.

  1. Create a unit test project.

    Create a new class library project
    Unit test project template
    Unit test project in Solution Explorer
  2. Add a reference to the project that contains the code you'll test.

    Add references to unit test project
    Add references to unit test project
  3. Code your unit test.

    Add asserts and code to your unit test

Try this next

  • Run unit tests

Or, dig deeper on MSDN:

  • How to: create a unit test project
Sign up for free
  • Home
  • Welcome
  • Features
  • News
  • Pricing
  • Information
  • Learn
  • Start
  • Code
  • Build
  • Test
  • Collaborate
  • Community
  • Forums
  • CodePlex
  • Blog
  • User Voice
  • Report a bug
  • Support
  • Service status
  • FAQ
  • Legal
  • Account
  • Sign in
  • Join today
  • microsoft
  • Give Us Feedback
  • Contact Us
  • Trademarks
  • Privacy Statement
  • © 2013 Microsoft