Fernando Machado Píriz's Blog

Posts about digital transformation, enterprise architecture and related topics

Test Driven Development with Visual Studio 2010 and C# 4.0

with 5 comments

This is the first post of a series about testing tools and techniques using Visual Studio 2010, Team Foundation Server 2010, Microsoft Test Manager 2010, and C# 4.0.

In Test Driven Development unit tests are written before the code under test. Visual Studio allows writing test cases first and simplifies generation from usage of skeletons of tested code. In this video you will see how to create a unit test for the Add method of a Calculator class, and how Visual Studio automatically generates the Calculator class and the Add method skeleton for us:

You can also download the video.

More videos coming soon… keep tuned!

Advertisements

Written by fernandomachadopiriz

May 13, 2010 at 1:48 pm

5 Responses

Subscribe to comments with RSS.

  1. […] the first post I showed how Visual Studio allows test driven […]

    Like

  2. […] the first post I showed how Visual Studio allows test driven development and in the second post how to […]

    Like

  3. Hey Fernando,

    It was a very nice example albeit a simple one. As I only have Visual Studio Professional Edition, I can’t quite do what you did. Can you tell me how it will deal with isolation frameworks e.g. Rhino Mocks, Moq, etc?

    Like

    DavidS

    April 13, 2011 at 2:23 pm

    • Thanks David. You’re right, most tests shown in this serie require Visual Studio Ultimate o Test versions. Haven’t use Moq, but some friend do and it integrates well in the process/environment. Haven’t used Moles? It’s an MS Research tool that complements existing Visual Studio testing features with mockup testing (although isn’t exactly the same as Moq).

      Like

      fernandomachadopiriz

      April 15, 2011 at 10:19 pm

  4. Hi! This is kind of off topic but I need some guidance from an established blog.
    Is it tough to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about making my own but I’m not sure where to begin. Do you have any points or suggestions? Thank you

    Like

    Heike

    June 24, 2013 at 7:14 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: