Refactor tests to use async/await and improve naming

Updated all test methods to use asynchronous programming with
`async` and `await`, replacing synchronous calls with
`.GetAwaiter().GetResult()`. This improves readability and
aligns with modern C# practices.

Renamed test methods to reflect their asynchronous nature and
better describe their behavior. Updated exception handling to
validate HTTP methods and request URIs while maintaining
original assertions.

Applied changes consistently across multiple test classes,
including `CommonApiTests`, `EndpointAuthApiTests`,
`EndpointParamsApiTests`, `EndpointsApiTests`,
`ProfileApiTests`, `RecActionApiTests`, and `ResultApiTests`.
This commit is contained in:
2026-05-20 13:18:13 +02:00
parent 9e90efb781
commit d34af1ac86
7 changed files with 20 additions and 20 deletions

View File

@@ -66,7 +66,7 @@ public class EndpointsApiTests : RecClientTestBase
}
[Test]
public void DeleteAsync_sends_payload_as_query_string()
public async Task DeleteAsync_sends_payload_as_query_string()
{
var (client, scope) = CreateScopedClient();
using var _ = scope;
@@ -80,7 +80,7 @@ public class EndpointsApiTests : RecClientTestBase
try
{
client.Endpoints.DeleteAsync(payload).GetAwaiter().GetResult();
await client.Endpoints.DeleteAsync(payload);
}
catch (ReCApiException ex)
{