I am assuming that as the code is standard C#, I can just use nUnit, TestDriven.net etc.
Have I missed something?
What “traps” have other people hit trying to do this?
I am assuming that as the code is standard C#, I can just use nUnit, TestDriven.net etc.
Have I missed something?
What “traps” have other people hit trying to do this?
Have you looked at the Silverlight Unit Testing Framework which is now part of the Silverlight Toolkit?
It's not been ported as part of the WP7 toolkit but some people have reported some success in using it anyway.
If you are talking about testing C# code in a Silverlight-based project, then there are some steps that need to be taken in order to use frameworks such as nUnit. The C# code in a Silverlight project will compile against the Silverlight framework binaries, so the binaries for nUnit won't work as-is since they are compiled against the standard .NET framework.
If you want to use nUnit, you can setup a regular C# class library and reference your Silverlight C# files into this project. You want to add them as a link, which is detailed here. From personal experience, this can get a little crazy because your file is linked in two places and the ability to link over the files are limited (if your Silverlight C# code references any Silverlight-specific binaries, you cannot perform this linking trick).
The other option is to use the Silverlight Unit Test Framework, the binaries for which can be found here. This works much like the Silverlight unit tester in the Silverlight Toolkit, except that it runs on the phone as a phone app.