Skip to content

Commit edb319b

Browse files
committed
Update AssertionExtensions.cs
1 parent 6193946 commit edb319b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/TestUtils/src/DeviceTests/AssertionExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static async Task<bool> WaitForCollect(params WeakReference[] references)
5656
var taskCollect = reference.WaitForCollect();
5757
try
5858
{
59-
await AssertEventuallyAsync(taskCollect);
59+
await AssertEventuallyAsync(async ()=> await taskCollect);
6060
}
6161
catch (XunitException)
6262
{
@@ -301,11 +301,11 @@ public static async Task AssertEventually(this Func<bool> assertion, int timeout
301301
}
302302
}
303303

304-
public static async Task AssertEventuallyAsync(this Task<bool> assertion, int timeout = 1000, int interval = 100, string message = "Assertion timed out")
304+
public static async Task AssertEventuallyAsync(this Func<Task<bool>> assertion, int timeout = 1000, int interval = 100, string message = "Assertion timed out")
305305
{
306306
do
307307
{
308-
if (await assertion)
308+
if (await assertion())
309309
{
310310
return;
311311
}
@@ -316,7 +316,7 @@ public static async Task AssertEventuallyAsync(this Task<bool> assertion, int ti
316316
}
317317
while (timeout >= 0);
318318

319-
if (!await assertion)
319+
if (!await assertion())
320320
{
321321
throw new XunitException(message);
322322
}

0 commit comments

Comments
 (0)