Example #1
0
 private void DiscoveryCompleteHandler(DiscoveryCompleteInfo info)
 {
     logger.Info("### DISCOVERY COMPLETE ###");
     logger.InfoFormat("Total number of tests (methods): {0}", info.TestCasesDiscovered);
     logger.InfoFormat("Number of selected tests (methods): {0}", info.TestCasesToRun);
     if (info.TestCasesToRun == 0)
     {
         // I ensured at beginning of Execute method that testsToRun is not empty
         // thus this case shouldn't occur
         // I tried implementing by using just cancellation here,
         // but it has some issues
         logger.Info("No tests to run");
         // Note that ExecutionCompleteHandler does not get triggered
         // when there are no tests to be run unless if Cancel() is called
         runner.Cancel();
         // Note that runner Status is not set to Idle if execution is canceled.
         executionCanceled = true;
     }
 }