
Book cover
Unit testing has become rather important in the last decade as the need for quality code increased. It is also an essential part of Test-Driven Design which is a part of Extreme Programming.
Probably the most common approach to do unit testing in .NET solutions is by creating special Tests projects in a pair to the library we want to test and perform the testing in NUnit . In Silverlight projects we would like to test the business domain logic on the server and the ViewModel classes on the Silverlight client side.
If you haven’t ever used unit testing read an excellent book The Art of Unit Testing with examples in C# which will guide through both the theory of unit testing and practical examples. There were also a presentation of Developing Testable Silverlight Application at the Microsoft PDC conference.
Note: I plan to enlarge this article later with a real example of Testable Silverlight Application.
I found article about Unit Testing in Silverlight 2
http://www.jeff.wilcox.name/2008/03/silverlight2-unit-testing/
Another webcast about Test Driven Development in Silverlight
http://zenthought.com/archive/2009/06/22/test-driven-development-for-silverlight-3-unit-testing.aspx