The 'Silverlight Unit Test Application' project type is missing from within Visual Studio 2012. I can see it in VS 2010, but not in VS2012. I have installed and re-installed the Silverlight 5 toolkit from codeplex. Creating and running a silverlight unit test project in VS2010 works, but when running the tests through R# in VS2012, I get "Inconclusive: Test wasn't run"
Any help / suggestions would be greatly appreciated.
This link has the answer that worked for me:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/5e991b0d-8061-4c4e-a17d-82b4abd58d6c/vs-2012-silverlight-unittest
I recommend starting a new Silverlight project and installing the SilverlightToolkit-Testing NuGet package. In your test files, put in usings for Microsoft.Silverlight.Testing and Microsoft.VisualStudio.TestTools.UnitTesting and use regular [TestClass] and [TestMethod] attributes. To run them, you can use the Toolkit test runner by putting
RootVisual = UnitTestSystem.CreateTestPage();
in your App.Application_Startup(), use Silverlight Unit Test Adapter (which currently is at v0.0.1 and doesn't really work), or (the best approach by far) install ReSharper and the AgUnit plugin.
It's possible to reference Silverlight libraries from ordinary .NET libraries. So, if you are going to unit test only your view models, you can move them to a separate project, create an ordinary (not Silverlight specific) unit testing project and add a reference to the project of view models.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With