From 566e3c42e8caa55ba8908b5d77b0fca35651cf8f Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Tue, 20 Oct 2026 16:36:02 +0200 Subject: [PATCH] Refactor WaitForEventAsync to ForEventAsync --- src/CuteUtils.Tests/Misc/WaitTests.cs | 4 ++-- src/CuteUtils/Misc/WaitUntil.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CuteUtils.Tests/Misc/WaitTests.cs b/src/CuteUtils.Tests/Misc/WaitTests.cs index 5bbc4ad..85b661f 100644 --- a/src/CuteUtils.Tests/Misc/WaitTests.cs +++ b/src/CuteUtils.Tests/Misc/WaitTests.cs @@ -60,7 +60,7 @@ public class WaitTests handler(); }); } - await Wait.WaitForEventAsync(subscribe, TimeSpan.FromSeconds(2)); + await Wait.ForEventAsync(subscribe, TimeSpan.FromSeconds(2)); } [TestMethod] @@ -72,7 +72,7 @@ public class WaitTests } _ = await Assert.ThrowsExactlyAsync(async () => { - await Wait.WaitForEventAsync(subscribe, TimeSpan.FromMilliseconds(200)); + await Wait.ForEventAsync(subscribe, TimeSpan.FromMilliseconds(200)); }); } diff --git a/src/CuteUtils/Misc/WaitUntil.cs b/src/CuteUtils/Misc/WaitUntil.cs index 4c84876..311dd7d 100644 --- a/src/CuteUtils/Misc/WaitUntil.cs +++ b/src/CuteUtils/Misc/WaitUntil.cs @@ -67,7 +67,7 @@ public static class Wait /// An action that subscribes a handler to the event. /// The maximum time to wait. Defaults to infinite. /// Thrown if the event is not raised within the timeout. - public static async Task WaitForEventAsync(Action subscribe, TimeSpan? timeout = null) + public static async Task ForEventAsync(Action subscribe, TimeSpan? timeout = null) { timeout ??= TimeSpan.MaxValue; TaskCompletionSource tcs = new TaskCompletionSource();