[TestFixture] public class ClassTest { [Test] public void TestRun() { CrossThreadTestRunner runner = new CrossThreadTestRunner(); runner.RunInSTA( delegate { Console.WriteLine(Thread.CurrentThread.GetApartmentState()); WindowsApplication1.Window1 obj = new WindowsApplication1.Window1(); double expected = 9; double result = obj.GetSomeValue(3); Assert.AreEqual(expected, result); }); } }