So I\'ve got this nice little MVVM solution, and things work great. I\'ve got a view model for a header bar that adjusts the icon based on the state of the application, etc. I\'
Building on other answers, here's the (NUnit) code that made my tests go green:
In AssemblyInfo.cs:
[assembly: RequiresSTA]
In its own file:
[SetUpFixture]
public class PreTestSetup
{
[SetUp]
public void Setup()
{
PackUriHelper.Create(new Uri("reliable://0"));
new FrameworkElement();
System.Windows.Application.ResourceAssembly = typeof (App).Assembly;
}
}
App is my main application class. Any class in the relevant assembly will do, presumably.