Skip to content

Commit

Permalink
WaitDoesNotAssertInAsyncCode
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara committed Mar 9, 2024
1 parent 3d30578 commit 1e0c0b2
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,29 @@ await executor.Execute(async () =>
}, cts.Token);
}


[Theory, MemberData(nameof(GetTargetThreadsAndBlockingCalls))]
public async Task WaitDoesNotAssertInAsyncCode(Executor executor, NamedCall method)
{
using var cts = CreateTestCaseTimeoutSource();
await executor.Execute(async () =>
{
await executor.StickyAwait(WebWorkerTestHelper.InitializeAsync(), cts.Token);

Exception? exception = null;
try
{
method.Call(cts.Token);
}
catch (Exception ex)
{
exception = ex;
}

Assert.Null(exception);
}, cts.Token);
}

[Theory, MemberData(nameof(GetTargetThreadsAndBlockingCalls))]
public async Task WaitAssertsOnSyncCallback(Executor executor, NamedCall method)
{
Expand Down

0 comments on commit 1e0c0b2

Please sign in to comment.