Remove await Task.FromResult() and unnecessary async modifiers (#16535)

* Remove await Task.FromResult and unnecessary async modifiers

* Remove usage of await Task.WhenAll() to avoid deadlocks

* Fix code formatting

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
Ronald Barendse
2025-03-03 06:47:37 +01:00
committed by GitHub
parent 064a71240e
commit 561d871677
126 changed files with 600 additions and 574 deletions

View File

@@ -75,14 +75,16 @@ public class UserIdKeyResolverTests : UmbracoIntegrationTest
}
[Test]
public async Task Unknown_Key_Throws()
public Task Unknown_Key_Throws()
{
Assert.ThrowsAsync<InvalidOperationException>(async () => await UserIdKeyResolver.GetAsync(Guid.NewGuid()));
return Task.CompletedTask;
}
[Test]
public async Task Unknown_Id_Throws()
public Task Unknown_Id_Throws()
{
Assert.ThrowsAsync<InvalidOperationException>(async () => await UserIdKeyResolver.GetAsync(1234567890));
Assert.ThrowsAsync<InvalidOperationException>(async () => await UserIdKeyResolver.GetAsync(1234567890));
return Task.CompletedTask;
}
}