private void RunTests(IEnumerable <TestDetails> selectedTests) { if (_testRunnerTask == null) { _viewModel.CanRunTests = false; _viewModel.TestsAreRunning = true; SetStatus("Running..."); var testClosure = selectedTests; NotifyUnrunTests(testClosure); _testRunnerTask = new TaskFactory().StartNew(() => { RemoteTestRunner runner = new RemoteTestRunner(_outputWriter); runner.RunTests(testClosure); _testRunnerTask = null; SetStatus("Done"); _viewModel.CanRunTests = true; _viewModel.TestsAreRunning = false; }); } }