Exemple #1
0
        public void TestClock_can_be_set_to_set_time(TestClock sut, DateTimeOffset pointInTime)
        {
            sut.SetTo(pointInTime);

            Assert.That(sut.UtcNow, Is.EqualTo(pointInTime.ToUniversalTime()));
        }
Exemple #2
0
        public void TestClock_can_be_advanced_by_specified_time_interval([Frozen] DateTimeOffset pointInTime, TestClock sut, TimeSpan advanceBy)
        {
            sut.AdvanceBy(advanceBy);

            Assert.That(sut.UtcNow, Is.EqualTo(pointInTime.ToUniversalTime() + advanceBy));
        }
 public void Initialize()
 {
     _testClock = new TestClock(Now);
 }
Exemple #4
0
 public void TestClock_can_be_initialized_with_set_time([Frozen] DateTimeOffset pointInTime, TestClock sut)
 {
     Assert.That(sut.UtcNow, Is.EqualTo(pointInTime.ToUniversalTime()));
 }
        public void Initialize()
        {
            _testClock = new TestClock(Now);

            _resetTime = Now.AddHours(-1);
        }