There are few options for running Silverlight unit tests on the build server. The November release of the Silverlight Toolkit doest support test automation from the command line, however it’s only experimental. In my testing I feel its just not yet there, I’ve seen issues with builds hanging, it doesn't work with IE6 on XP (which is still widely deployed within large organizations), and its messy to get the test results to merge into a single file to integrate with Cruise Control (if that's what your using). Finally, all the test targets are within the csproj files which makes automating from a single build script problematic (given the .sln isn’t itself an msbuild file, you end up with hardcoded paths in your build script). The preview bits may address these issues but there not official just yet. Its worth keeping an eye on these as the test runner is massively improved.
The most reliable option I’ve found is StatLight. It works great with Team City and support multiple test frameworks.
Where it really pays off is running tests via the command line. For example the following will run all the test for Test.xap (which in this case we’ll pretend its a test project from the Silverlight Toolkit testing framework). The --Continuous flag will keep StatLight running continuously and automatically re-run the tests when the .xap change, great for TDD.
StatLight.exe -x=PathToTestProject\bin\Debug\Tests.xap --Continuous SomeOptionalTagAsUsedByYourTestFramework
Jump over to your MS build script and add a target similar to the below for running tests via the build server. The --teamcity flag converts the output of the test (via the consoles standard output stream) to a format that team city can understand. The awesomeness of Team City means this just works :).
<Target Name="RunSilverlightTests">
<Exec Command="".\Tools\StatLight\StatLight.exe" -x="SomePathToTestProject\(SomeTests.xap" --teamcity" />
</Target>
When using MSTest for Silverlight (aka the Silverlight Toolkit Test Framework), StatLight will analyses your test xap, fire up a Winform in the background, host Silverlight, run the test and collect the output. To date this is the most reliable approach I’ve found.