Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V6/contrib #336

Merged
merged 5 commits into from
Nov 20, 2024
Merged

V6/contrib #336

merged 5 commits into from
Nov 20, 2024

Conversation

nikcio
Copy link
Owner

@nikcio nikcio commented Nov 20, 2024

No description provided.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: OK

Change in average Code Health of affected files: +0.07 (9.93 -> 10.00)

  • Improving Code Health: 2 findings(s) ✅

View detailed results in CodeScene

Comment on lines -39 to -46
public async Task<TrackErrorStatusCodeResponse> TrackErrorStatusCodeAsync(
IResolverContext resolverContext,
[GraphQLDescription("Status code of the client error.")] int statusCode,
[GraphQLDescription("The URL that generated the client error.")] string url,
[GraphQLDescription("The time and date at which the client error was generated")] DateTime timestamp,
[GraphQLDescription("The URL from which the current URL is requested")] string? referrer)
{
ArgumentNullException.ThrowIfNull(resolverContext);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Excess Number of Function Arguments
TrackErrorStatusCodeAsync is no longer above the threshold for number of arguments

Comment on lines -54 to -86
[InlineData("test-3", "https://example-site.com/not-found", "2024-05-30T14:10:20+01:00", "https://site-example.com/not-found", 404, true)]
public async Task UrlTrackerExampleQuery_TrackErrorStatusCode_Async(
string testCase,
string url,
string timeStamp,
string? referrer,
int statusCode,
bool expectSuccess)
{
var snapshotProvider = new SnapshotProvider($"{_urlTrackerExampleSnapshotPath}/TrackErrorStatusCode");
HttpClient client = _factory.CreateClient();

using var request = JsonContent.Create(new
{
query = UrlTrackerExampleQueries.TrackErrorStatusCode,
variables = new
{
url,
timeStamp,
referrer,
statusCode
}
});

HttpResponseMessage response = await client.PostAsync("/graphql", request).ConfigureAwait(true);

string responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(true);

string snapshotName = $"UrlTrackerExample_TrackErrorStatusCode_{testCase}.snap";

await snapshotProvider.AssertIsSnapshotEqualAsync(snapshotName, responseContent).ConfigureAwait(true);
Assert.Equal(expectSuccess, response.IsSuccessStatusCode);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Excess Number of Function Arguments
UrlTrackerExampleQuery_TrackErrorStatusCode_Async is no longer above the threshold for number of arguments

Copy link

sonarcloud bot commented Nov 20, 2024

@nikcio nikcio merged commit d1492ac into contrib Nov 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant