From 3a5a6a638f43715b28015ad62307bbe09c6aec60 Mon Sep 17 00:00:00 2001 From: Mattias Nordqvist Date: Sun, 16 Jun 2024 19:03:57 +0200 Subject: [PATCH] :( --- .../TimeTravelersClockTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DotNetThoughts.TimeKeeping.Tests/TimeTravelersClockTests.cs b/DotNetThoughts.TimeKeeping.Tests/TimeTravelersClockTests.cs index 7df1445..16603e9 100644 --- a/DotNetThoughts.TimeKeeping.Tests/TimeTravelersClockTests.cs +++ b/DotNetThoughts.TimeKeeping.Tests/TimeTravelersClockTests.cs @@ -7,7 +7,7 @@ namespace DotNetThoughts.TimeKeeping.Tests; public class TimeTravelersClockTests { - private static TimeSpan _allowedDeviation = TimeSpan.FromMilliseconds(10); + private static TimeSpan _allowedDeviation = TimeSpan.FromMilliseconds(100); [Fact] public void FreezeTime() { @@ -64,7 +64,7 @@ public void BaselineMocksNow() var baseLine = now.AddDays(-1); sut.SetBaseline(baseLine); sut.UtcNow().Should().BeCloseTo(baseLine, _allowedDeviation); - var slept = Sleep(20); + var slept = Sleep(1000); sut.UtcNow().Should().BeCloseTo(baseLine.Add(slept), _allowedDeviation); } @@ -94,7 +94,7 @@ public void AdvanceFrozenTimeAndThenThaw() sut.Freeze(frozenTime); sut.Advance(TimeSpan.FromDays(1)); sut.Thaw(); - var slept = Sleep(20); + var slept = Sleep(1000); sut.UtcNow().Should().BeCloseTo(frozenTime.AddDays(1).Add(slept), _allowedDeviation); } @@ -110,9 +110,9 @@ public void AComplicatedTest() sut.UtcNow().Should().BeCloseTo(baseLine.Add(timer.Elapsed), _allowedDeviation); var frozen = sut.Freeze(); sut.UtcNow().Should().Be(frozen); - var sleptWhileFrozen = Sleep(200); + var sleptWhileFrozen = Sleep(2000); sut.Thaw(); - Sleep(20); + Sleep(1000); sut.UtcNow().Should().BeCloseTo(baseLine.Add(timer.Elapsed).Add(-sleptWhileFrozen), _allowedDeviation); }