web 2.0

Unit Testing of Silverlight LoB Applications

Book cover

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.