From f80fa5eeaa2090a99efc99b2e93edf3e7a621e59 Mon Sep 17 00:00:00 2001 From: sakno Date: Wed, 10 Jul 2024 22:08:44 +0300 Subject: [PATCH] Improved test coverage --- src/DotNext.Tests/Threading/AsyncTriggerTests.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/DotNext.Tests/Threading/AsyncTriggerTests.cs b/src/DotNext.Tests/Threading/AsyncTriggerTests.cs index 993e7f1d9..49cd74b1d 100644 --- a/src/DotNext.Tests/Threading/AsyncTriggerTests.cs +++ b/src/DotNext.Tests/Threading/AsyncTriggerTests.cs @@ -56,6 +56,22 @@ public static async Task SignalAndWait() await task2; } + + [Fact] + public static async Task SignalAndWaitWithTimeout() + { + using var trigger = new AsyncTrigger(); + + var task1 = trigger.WaitAsync(); + var task2 = trigger.SignalAndWaitAsync(false, true, DefaultTimeout); + + await task1; + False(task2.IsCompleted); + + True(trigger.Signal()); + + True(await task2); + } [Fact] public static async Task SignalEmptyQueue()