Hi All
I need to start using unit tests in my code . The problem is that i never written unit tests . Can you please recommend me some good sites and book how to write correctly unit tests and to use nunit application .
Thanks a lot for help.
Hi All
I need to start using unit tests in my code . The problem is that i never written unit tests . Can you please recommend me some good sites and book how to write correctly unit tests and to use nunit application .
Thanks a lot for help.
I would recommend you get The Art of Unit Testing by Roy Osherove
It may be a little dated, but the one I started with was Test Driven Development In Microsoft.NET.
I think Pragmatic Unit Testing is a good complementary book for Osherove's Art of Unit Testing. Pragmatic unit testing deals with flushing out errors and different types of targeted testing, whereas Roy's book is a higher level and more general book that deals with a wider range of concepts.
As a beginner, I found the Pragmatic book an excellent starting point.
Here are some other quality resources:
Misko's guide to writing testable code. One of the main battles when writing tests is ... how to structure code to make it testable. Misko's guides are invaluable.
Roy Osherove's cranky test review videos. The second battle we face is writing good, clear, maintainable tests. It's really easy to write bad/brittle/unmaintainable tests, so it is important to be aware of common mistakes. These videos can be a bit cranky at times, but they're full of good tips.