public void TestWaitOne() {
      GenericTimeSource timeSource = new GenericTimeSource();
      AutoResetEvent waitEvent = new AutoResetEvent(true);

      Assert.IsTrue(timeSource.WaitOne(waitEvent, TimeSpan.FromMilliseconds(1).Ticks));
      Assert.IsFalse(timeSource.WaitOne(waitEvent, TimeSpan.FromMilliseconds(1).Ticks));
    }
    public void TestTicksWithStopwatch() {
      GenericTimeSource timeSource = new GenericTimeSource(true);
      long ticks1 = timeSource.Ticks;
      long ticks2 = timeSource.Ticks;

      Assert.That(ticks2, Is.GreaterThanOrEqualTo(ticks1));
    }
    public void TestTicksWithTickCount() {
      GenericTimeSource timeSource = new GenericTimeSource(false);
      long ticks1 = timeSource.Ticks;
      long ticks2 = timeSource.Ticks;

      Assert.That(ticks2, Is.GreaterThanOrEqualTo(ticks1));
    }
    public void TestCurrentUtcTime() {
      GenericTimeSource timeSource = new GenericTimeSource();

      Assert.That(
        timeSource.CurrentUtcTime, Is.EqualTo(DateTime.UtcNow).Within(10).Seconds
      );
    }
        public void TestWaitOne()
        {
            GenericTimeSource timeSource = new GenericTimeSource();
            AutoResetEvent    waitEvent  = new AutoResetEvent(true);

            Assert.IsTrue(timeSource.WaitOne(waitEvent, TimeSpan.FromMilliseconds(1).Ticks));
            Assert.IsFalse(timeSource.WaitOne(waitEvent, TimeSpan.FromMilliseconds(1).Ticks));
        }
        public void TestTicksWithTickCount()
        {
            GenericTimeSource timeSource = new GenericTimeSource(false);
            long ticks1 = timeSource.Ticks;
            long ticks2 = timeSource.Ticks;

            Assert.That(ticks2, Is.GreaterThanOrEqualTo(ticks1));
        }
        public void TestTicksWithStopwatch()
        {
            GenericTimeSource timeSource = new GenericTimeSource(true);
            long ticks1 = timeSource.Ticks;
            long ticks2 = timeSource.Ticks;

            Assert.That(ticks2, Is.GreaterThanOrEqualTo(ticks1));
        }
        public void TestCurrentUtcTime()
        {
            GenericTimeSource timeSource = new GenericTimeSource();

            Assert.That(
                timeSource.CurrentUtcTime, Is.EqualTo(DateTime.UtcNow).Within(10).Seconds
                );
        }
 public void TestDefaultConstructor() {
   GenericTimeSource timeSource = new GenericTimeSource();
 }
 public void TestDefaultConstructor()
 {
     GenericTimeSource timeSource = new GenericTimeSource();
 }