Creating a testable WebClient for Silverlight unit testing

Testability is important to today’s developers, and without a mocking framework available for Silverlight developers today, it is possible, albeit with a little extra work, to create testable components.

Maurice de Beijer has blogged about his solution for creating a testable Flickr web service API. He’s created TestableWebClient and TestableOpenReadCompletedEventArgs types to assist with this, and kept the abstraction simple and to-the-point.

I agree with Maurice’s comments: it isn’t perfect, it isn’t awful; it isn’t pretty; but hey, it does get the job done, and he’s found a good solution for this today.

Maurice also previously posted his own introduction guide to Silverlight unit testing.

Just wanted to pass along, definitely check this out!

Comments

  1. February 24th, 2009 | 11:21 am

    There’s a mocking framework for Silverlight available now :)

    http://moq.me/get

    Enjoy!