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:
2026-05-20 13:50:55 +02:00
parent 12f4bf8828
commit afd5cd5fbd
6 changed files with 35 additions and 29 deletions

View File

@@ -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>());
}

View File

@@ -43,14 +43,14 @@ public class RecActionApiTests : 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? actions = await client.RecActions.GetDynamicAsync();
dynamic? actions = await client.RecActions.GetAsync();
Assert.That(actions, Is.Not.Null);
Assert.That(actions, Is.TypeOf<JsonElement>());
Assert.That(((JsonElement)actions).ValueKind, Is.EqualTo(JsonValueKind.Array));
@@ -104,13 +104,13 @@ public class RecActionApiTests : RecClientTestBase
}
[Test]
public void GetDynamicAsync_with_unknown_profile_throws_not_found()
public void GetAsync_non_generic_with_unknown_profile_throws_not_found()
{
var (client, scope) = CreateScopedClient();
using var _ = scope;
var ex = Assert.ThrowsAsync<ReCApiException>(async () =>
await client.RecActions.GetDynamicAsync(profileId: long.MaxValue));
await client.RecActions.GetAsync(profileId: long.MaxValue));
Assert.That(ex, Is.Not.Null);
Assert.That(ex!.StatusCode, Is.EqualTo(HttpStatusCode.NotFound));

View File

@@ -38,14 +38,14 @@ public class ResultApiTests : 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 results = await client.Results.GetDynamicAsync();
dynamic? results = await client.Results.GetAsync();
Assert.That(results, Is.Not.Null);
Assert.That(results, Is.TypeOf<JsonElement>());
}