There is a good book called "Pragmatic Unit Testing with NUnit" by Thompson and Hunt.
How I started, and it gives a good idea.
For more information on how and what to test in general, I recommended Beck. Unit Testing by Osherov and Test Driven Development.
Also take a look at this useful summary card also from Thompson and Hunt.
http://media.pragprog.com/titles/utj/StandaloneSummary.pdf .
These concepts are further explained in their book.
Update: I am not sure that I can recommend any books that describe the mechanics of creating your project, but I can offer some basic recommendations. Create a separate test project for each project that you want to test. Make sure you do not mix system integration / testing with your unit tests. One way to ensure this is to distinguish between test projects. for example, I might have something like
- CustomLibraryCode.proj // source project
- CustomlibraryCodeTests.Unit.proj // unit test project
- CustomLibraryCodeTests.Integration.proj // Integration Testing Project
This means that your unit tests, which should be run quickly and easily, can be performed in isolation from integration tests, which can usually have dependencies on the database, file system, etc. and tend to be slower and more fragile.
source share