daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Oct 19th, 2018 87 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. static void RebuildTests ()
  2.         {
  3.             throttling.Cancel ();
  4.             throttling = new CancellationTokenSource ();
  5.             Task.Delay (ThrottlingTimeout, throttling.Token).ContinueWith (async (task) => {
  6.                 if (task.IsCanceled)
  7.                     return;
  8.                 try {
  9.                     if (rootTests != null) {
  10.                         foreach (IDisposable t in rootTests)
  11.                             t.Dispose ();
  12.                     }
  13.                     List<UnitTest> list = new List<UnitTest> ();
  14.                     rebuildTestsCts.Cancel ();
  15.                     rebuildTestsCts = new CancellationTokenSource ();
  16.                     var token = rebuildTestsCts.Token;
  17.                     var items = IdeApp.Workspace.Items.ToArray ();
  18.                     await Task.Run (() => {
  19.                         foreach (WorkspaceItem it in items) {
  20.                             if (token.IsCancellationRequested)
  21.                                 return;
  22.                             UnitTest t = BuildTest (it);
  23.                             if (t != null)
  24.                                 list.Add (t);
  25.                         }
  26.                     }, token);
  27.                     if (token.IsCancellationRequested)
  28.                         return;
  29.                     rootTests = list.ToArray ();
  30.                     NotifyTestSuiteChanged ();
  31.                 } catch (OperationCanceledException) {
  32.                 } catch (Exception ex) {
  33.                     LoggingService.LogError ("Exception gathering unit tests.", ex);
  34.                 }
  35.             }, throttling.Token, TaskContinuationOptions.None, Runtime.MainTaskScheduler);
  36.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top