From 9897e7d1fc577e8441109af1f2ea484b7f2c398c Mon Sep 17 00:00:00 2001 From: Andres Gutierrez Date: Mon, 16 Oct 2023 14:07:21 -0500 Subject: [PATCH] Deterministic scheduler tests --- Nixie.Tests/TestScheduler.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Nixie.Tests/TestScheduler.cs b/Nixie.Tests/TestScheduler.cs index afae59d..efad7db 100644 --- a/Nixie.Tests/TestScheduler.cs +++ b/Nixie.Tests/TestScheduler.cs @@ -16,7 +16,9 @@ public async void TestCreatePeriodicTimer() await Task.Delay(5500); - Assert.True(((PeriodicTimerActor)actor.Runner.Actor!).GetMessages("hello") >= 5); + int numberMessages = ((PeriodicTimerActor)actor.Runner.Actor!).GetMessages("hello"); + + Assert.Equal(6, numberMessages); } [Fact] @@ -34,13 +36,13 @@ public async void TestCreatePeriodicTimerExternalStop() int numberMessages = ((PeriodicTimerActor)actor.Runner.Actor!).GetMessages("hello"); - Assert.True(numberMessages == 2 || numberMessages == 3); + Assert.Equal(3, numberMessages); await Task.Delay(2500); numberMessages = ((PeriodicTimerActor)actor.Runner.Actor!).GetMessages("hello"); - Assert.True(numberMessages == 2 || numberMessages == 3); + Assert.Equal(3, numberMessages); } [Fact]