Skip to content

Commit 6ed00ea

Browse files
committed
Replaced .Result in async actions (#128)
1 parent 9e57031 commit 6ed00ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MyTested.AspNetCore.Mvc.Core/Builders/Controllers/ControllerActionCallBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public IActionResultTestBuilder<TActionResult> Calling<TActionResult>(Expression
4545

4646
try
4747
{
48-
actionResult = actionInfo.ActionResult.Result;
48+
actionResult = Task.Run(async () => await actionInfo.ActionResult).Result;
4949
}
5050
catch (AggregateException aggregateException)
5151
{
@@ -87,7 +87,7 @@ public IVoidActionResultTestBuilder Calling(Expression<Func<TController, Task>>
8787

8888
try
8989
{
90-
actionInfo.ActionResult.Wait();
90+
Task.Run(async () => await actionInfo.ActionResult).Wait();
9191
}
9292
catch (AggregateException aggregateException)
9393
{

0 commit comments

Comments
 (0)