2010年6月27日 星期日

[.NET] How to create unit test with Visual Studio 2005

Introduction
If we want to do unit test, we can use Visual Studio Test Project to implement it.
And Visual Studio give us a very easy tool to implement unit test.
This article will demo it.

How to create Unit Test

First, we need to create a dll project, I named XDXD.
And create class XDXD and implement this class.


Then use Test Project to Add a new Unit Test.

The wizard will dispaly XDXD class's properties and methods.

Check XDXD class then click OK.




Visual Studio will create a XDXDTest.cs file and generate Unit Test code.

沒有留言:

張貼留言

Hello