Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I write .NET unit tests?

Tags:

.net

tdd

How do I write unit tests in .NET?

Specifically Visual Studio 2005?


1 Answers

If you're using one of the Visual Studio Team Suite products, you reference Microsoft.VisualStudio.TestTools.UnitTesting, decorate your test classes with the TestClass attribute, and decorate your test methods with the TestMethod attribute.

The approach for NUnit is similar, except that you reference NUnit.Framework, the class will be decorated with TestFixture, and the test methods will be decorated with Test.

like image 133
jonsequitur Avatar answered Aug 16 '26 10:08

jonsequitur