Exemplo n.º 1
0
    public void ShouldTimeThroughContext() {
      var signaler = new ManualResetEvent(false);
      var timer = new Timer();
      var snapshot = new Snapshot(new long[0]);
      long count = 0;
      timer.Time().Stop();

      timer.GetCount((x, context) => count = x);
      timer.Run(() => signaler.Set());

      signaler.WaitOne();

      Assert.That(count, Is.EqualTo(1), "the timer has count of 1");
    }