Refactor: Rename GetDynamicAsync to GetAsync
Renamed `GetDynamicAsync` to `GetAsync` across `ProfileApi.cs`, `RecActionApi.cs`, and `ResultApi.cs` to improve consistency and align with naming conventions for asynchronous methods. Updated XML documentation to clarify that the non-generic `GetAsync` overload returns a dynamically deserialized payload, typically a `System.Text.Json.JsonElement`. Highlighted its relation to the generic `GetAsync<T>` method. Adjusted method signatures for both `NETFRAMEWORK` and non-`NETFRAMEWORK` code paths. Updated test files (`ProfileApiTests.cs`, `RecActionApiTests.cs`, and `ResultApiTests.cs`) to reflect the renaming, including test method names and assertions. These changes enhance code readability, maintainability, and consistency.
This commit is contained in:
@@ -36,13 +36,13 @@ public class ProfileApiTests : RecClientTestBase
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetDynamicAsync_with_unknown_id_throws_not_found()
|
||||
public void GetAsync_non_generic_with_unknown_id_throws_not_found()
|
||||
{
|
||||
var (client, scope) = CreateScopedClient();
|
||||
using var _ = scope;
|
||||
|
||||
var ex = Assert.ThrowsAsync<ReCApiException>(async () =>
|
||||
await client.Profiles.GetDynamicAsync(id: long.MaxValue));
|
||||
await client.Profiles.GetAsync(id: long.MaxValue));
|
||||
|
||||
Assert.That(ex, Is.Not.Null);
|
||||
Assert.That(ex!.StatusCode, Is.EqualTo(HttpStatusCode.NotFound));
|
||||
@@ -50,14 +50,14 @@ public class ProfileApiTests : RecClientTestBase
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task GetDynamicAsync_without_filters_returns_dynamic_payload_or_throws_not_found()
|
||||
public async Task GetAsync_non_generic_returns_dynamic_payload_or_throws_not_found()
|
||||
{
|
||||
var (client, scope) = CreateScopedClient();
|
||||
using var _ = scope;
|
||||
|
||||
try
|
||||
{
|
||||
dynamic profiles = await client.Profiles.GetDynamicAsync();
|
||||
dynamic? profiles = await client.Profiles.GetAsync();
|
||||
Assert.That(profiles, Is.Not.Null);
|
||||
Assert.That(profiles, Is.TypeOf<JsonElement>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user