NUnit with Windows Phone 7

I'd like to unit test my Windows Phone 7 libraries with NUnit.

Is there a version of NUnit compatible with Windows Phone 7?


You might also look at - it is a Silverlight and WP7 unit test framework/runner, that also has an add-in DLL for nunit/mstest so you can write tests and have the same test code run in .NET, Silverlight and WP7.

As long as you are testing non-async behaviors, UnitDriven is pretty compatible with nunit (we built it to run a few hundred pre-existing nunit tests). It does have its own model for async tests - again specifically designed so the same test code runs in .NET, SL and WP7.

What you are searching for is nunit-silverlight. You need to reference "NUnit.Silverlight.Framework.dll" and "NUnit.Silverlight.Compatibility.dll" (SilverLight 3 versions), and make all references "local copy", even the .NET framework.

If you use Visual Studio Express Edition, there is still some obstacles that I detailed a bit more on my blog. In short: Express Edition doesn't include tests or add-ins, and it should work fine with external test runners but for my part I've got an exception in NUnit's GUI, so one may need something else to run his tests (NUnit-Console, Gallio, Autotest.NET, ...). I use TddBarForPhone (available on codeplex), a tool I made which runs NUnit-Console after each build and color the results in red or green.

As Windows Phone 7 is basically just Silverlight 3 I suspect that it will be fine.

There are multiple posts about using NUnit with Silverlight, so give them a try and you will probably have lots of success.

Here is one on using TestDriven.Net and NUnit with Silverlight:

I have recently discoverted the following tools which can be additionaly helpful for CI-Integration.

and more on that (which is a series of articles having 5 parts actually):

I found a great screencast recently that shows how to wire up NUnit so you can tdd on the Windows Phone 7 platform.

It's not using any silverlight templates/etc just a plain WP7 class library and NUnit

I've had a port of this ready for a while and finally uploaded it to

Install-Package NUnit.WP

NuGet package:


Need Your Help

Alternatives for 3 lines of java-like code?

python python-2.7

Assume you have a function, that sometimes returns a value, and sometimes doesn't, because there really is nothing you could return in this case, not even a default value or something. Now you want...

How to include the replaced string in the replacement in Eclipse?

regex eclipse string

I am using the following regex to find strings of type