Silverlight 5 Unit Testing in Visual Studio 2012

Visual Studio 2012 does not have the Silverlight Unit Test Application project project. I see this in VS 2010, but not in VS2012. I installed and reinstall the Silverlight 5 toolkit from the code. Creating and starting a silverlight Unit Test project in VS2010 works, but when starting tests through R # in VS2012 I get "Inconclusive: Test has not been started"

Any help / suggestions would be greatly appreciated.

+6
source share
3 answers

This link has an 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 of the NuGet package. In the test files, enter for Microsoft.Silverlight.Testing and Microsoft.VisualStudio.TestTools.UnitTesting and using regular [TestClass] and [TestMethod]. To run them, you can use the Toolkit test runner by placing RootVisual = UnitTestSystem.CreateTestPage(); in your App.Application_Startup (), use the Silverlight Unit Test Adapter (which is currently at v0.0.1 and doesn't really work), or (the best approach by far) install ReSharper and the AgUnit plugin.

+4
source

It is possible to map Silverlight libraries from regular .NET libraries. So, if you go to the unit test only your view models, you can move them to a separate project, create a regular (not Silverlight) unit testing project and add a link to the view model project.

+1
source

I managed to get the Silverlight module testing by adding the Silverlight Class library project and adding links to Microsoft.Silverlight.Testing version 5.0.5.0 and Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight version 5.0.5.0.

I exported this as a project template.

-2
source

All Articles