title: Quartz.net CancellationToken
body: <p>In my scheduler, implemented with quartz.net v3, i'm trying to test the behaviour of the cancellation token:</p>
  
  <pre><code>....
  IScheduler scheduler = await factory.GetScheduler();
  ....
  var tokenSource = new CancellationTokenSource();
  CancellationToken ct = tokenSource.Token;
  // Start scheduler
  await scheduler.Start(ct);
  // some sleep 
  await Task.Delay(TimeSpan.FromSeconds(60));
  // communicate cancellation
  tokenSource.Cancel();
  </code></pre>
  
  <p>I have a test Job that runs infinitely and in the <code>Execute</code> method checks the cancellation token:</p>
  
  <pre><code>public async Task Execute(IJobExecutionContext context)
  {
      while (true)
      {
          if (context.CancellationToken.IsCancellationRequested)
          {
              context.CancellationToken.ThrowIfCancellationRequested();
          }
      }
  }
  </code></pre>
  
  <p>I would expect that when <code>tokenSource.Cancel()</code> is fired the job will enter in the <code>if</code> and throws the Exception. But it doesn't work.</p>