Firedragon
Firedragon

Reputation: 3733

Automated Silverlight 5 Unit testing for business logic

Our team is using Silverlight 5 for development as it has features we require going forward. I have discovered that NUnit doesn't work as standard as it isn't Silverlight and that the tools available for Silverlight testing appear to primarily be aimed at running within browsers and are a pain to automate it seems.

However a lot of the code I want to test is the View Models which aren't specifically Silverlight, so I was hoping there is a way of using NUnit or similar to just test this and integrating into a build server (which is currently being decided upon)

So, is it possible to test Silverlight in this way?

Upvotes: -1

Views: 1345

Answers (2)

chris.house.00
chris.house.00

Reputation: 3301

The best solution I have found is AgUnit:

http://agunit.codeplex.com/

AgUnit is an open source plugin for ReSharper. This solution of course assumes that you're using ReSharper. AgUnit allows you to run Silverlight unit tests in the ReSharper test running. Unfortunately, I just checked the AgUnit site and it looks like they only support Silverlight 5. You may want to head over there and find out about their plans for supporting Silverlight 5 though as it is a great plugin.

Prior to using AgUnit, we were using Statlight and found it to be pretty good as well, just not quite as convenient as AgUnit.

Upvotes: 2

Braulio
Braulio

Reputation: 1728

I haven't tried it but looks interesting:

http://statlight.codeplex.com/

and what about third parties (maybe Telerik offers something on their testing suite).

I know it's no ideal, but if it's just VM and non dependant on UI you can link the files to a WPF project and execute the unit tests (in our case we had to share two versions the SL and the WPF one that's why we chose to test our VM in the WPF version :-)).

The unit testing from Silverlight (toolkit) I haven't found a way to link it to an automated build process

Upvotes: 2

Related Questions