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:
@@ -66,7 +66,7 @@ public class EndpointAuthApiTests : 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 EndpointAuthApiTests : RecClientTestBase
|
||||
|
||||
try
|
||||
{
|
||||
client.EndpointAuth.DeleteAsync(payload).GetAwaiter().GetResult();
|
||||
await client.EndpointAuth.DeleteAsync(payload);
|
||||
}
|
||||
catch (ReCApiException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user