I was beginning to wonder if TDD would ever make
it into mainstream development in Sri Lanka, but looks like it’s slowly happening.
The following is my reply to a post on the .NET Forum
Based on my understanding so far unit testing works
best for testing the Business Logic of your system. And the de facto tool for unit
testing in .NET is nUnit. The most effective way to test your application using nUnit
is to use a development methodology known as TDD. The following links should help
you out.
nUnit - http://nunit.org/
'The' Book - Test
Driven Development in Microsoft .NET
'The' Site - http://www.testdriven.com
Questions
that I had when starting out on unit testing.
How do I unit test the UI?
Practically I don't think it will be feasible to unit test the UI layer
in an enterprise level application, but if your interested try these.
http://nunitforms.sourceforge.net/
http://nunitasp.sourceforge.net/
How do I unit test the Data Access Layer?
Here too I don't think you would really
gain much from unit testing since you would pretty much be testing the database,
network connections, etc. But I did find this article that can show you a way
to do it.
MSDN:
Unit Test Your .NET Data Access Layer
On the other hand you could also take a look at
the NMock framework that allows you to mock objects that are resource intensive, etc. http://www.nmock.org/
Hope this helps.