The Magic of Unit Testing
I’ve never done unit testing…ever. I’ve heard the phrase and wondered what the heck it was for some time now, so I decided to go and download NUnit, a unit testing framework for .NET. Now that I’ve started playing with it, I really like it.
Basically, create a special project with some special classes that run tests on your objects. Then, load the compiled DLL into the NUnit console and let it run. The tests are executed and you are told if any of them fail and why. It really makes debugging your classes much, much easier. You can now count me among the converted.
Disclaimer: Any viewpoints and opinions expressed in this article are those of Nicholas C. Zakas and do not, in any way, reflect those of my employer, my colleagues, Wrox Publishing, O'Reilly Publishing, or anyone else. I speak only for myself, not for them.