protected void CommandOk()
 {
     if (_viewModel.TypesTreeToTest.TestAssemblies.All(a => a.IsIncluded == false))
     {
         _svc.Logging.ShowError(UserMessages.ErrorNoTestsToRun(), _viewModel.View);
         return;
         //   throw new Exception(UserMessages.ErrorNoTestsToRun());
     }
     tcs.TrySetResult(new object());
     _viewModel.Close();
 }
        private async Task <MutationSessionChoices> WaitForResult(bool auto, Task mainTask)
        {
            _viewModel.ShowDialog();            // blocking if gui
            if (!auto && !tcs.Task.IsCompleted) //CommandOk was not called
            {
                tcs.TrySetCanceled();
            }
            if (auto)
            {
                tcs.TrySetResult(new object());
            }
            await mainTask;

            if (auto)
            {
                if (_viewModel.TypesTreeToTest.TestAssemblies.All(a => a.IsIncluded == false))
                {
                    //_svc.Logging.ShowError(UserMessages.ErrorNoTestsToRun(), _viewModel.View);
                    throw new Exception(UserMessages.ErrorNoTestsToRun());
                }
            }

            return(AcceptChoices());
        }