SilverLight unit test framework runs test in external class libraries

I am currently studying different options for unit testing of Silverlight applications. One of the frameworks is Microsoft’s Silverlight Unit Testing Framework (the main software developed by Jeff Wilcox, http://www.jeff .wilcox.name/2010/05/sl3-utf-bits/).

One scenario I am working on is to run the same test on Silverlight 3 (PC) and Windows Phone 7. The Silverlight Unit Test Framework (SLUT) runs on PCs and mobile phones. To prevent having to copy or link files, I want to put my tests into a shared test library, which can be loaded using SLUT’s WP7 application or SLUT’s Silverlight 3 application loading .

So my question is: Will SLUT define load unit tests in the referenced class library, or only in the execution assembly?

I did some research, and as a result, you can tell the SLUT test runner which components to test. You This can be done by configuring the test settings when creating the test page.

private void Application_Startup(object sender, StartupEventArgs e)
{
var setting = UnitTestSystem.CreateDefaultSettings();
setting.TestAssemblies.Add(typeof(TestInReferencedAssembly).Assembly);
RootVisual = UnitTestSystem.CreateTestPage(setting);
)

In the code example above, TestInReferencedAssembly is a test defined in the class library referenced by the application running the SLUT test runner. You can add the assembly that the test runner should scan to find unit tests. In this case Next, I added the assembly to which TestInReferencedAssembly belongs.

I did not test whether this function works when performing SLUT on Windows Phone 7, but if it does, we should be able to run the same on Phone and Desktop Test suite.

I am currently studying different options for unit testing of Silverlight applications. One of the frameworks is Microsoft’s Silverlight unit testing framework (the main software developed by Jeff Wilcox, http://www.jeff.wilcox.name/2010/05/sl3-utf-bits/).

One scenario I am studying is in Silverlight 3 (PC) and Windows Phone The same tests are run on 7. The Silverlight Unit Test Framework (SLUT) runs on PC and mobile phones. In order to prevent having to copy or link files, I want to put my tests into a shared test library, which can use SLUT’s WP7 application or use SLUT’s Silverlight 3 application Order loading.

So my question is: Will SLUT define loading unit tests in the referenced class library, or only in the execution assembly?

I did some research, and as a result, you can tell the SLUT test runner which components to test. You can do this by configuring the test settings when creating the test page This operation.

private void Application_Startup(object sender, StartupEventArgs e)
{
var setting = UnitTestSystem.CreateDefaultSettings();
setting.TestAssemblies.Add(typeof(TestInReferencedAssembly).Assembly);
RootVisual = UnitTestSystem.CreateTestPage(setting);
)

In the above code example, TestInReferencedAssembly is Tests defined in the class library referenced by the application running the SLUT test runner. You can add assemblies that the test runner should scan to find unit tests. In this case, I added the assembly to which TestInReferencedAssembly belongs. /p>

I did not test whether this function works when performing SLUT on Windows Phone 7, but if it does, we should be able to run the same test suite on Phone and Desktop.

< p>

Leave a Comment

Your email address will not be published.