Skip to content

Conversation

@martincostello
Copy link
Collaborator

  • Add a test that uses an NSwag-generated client.
  • Move/rename the tests to avoid ambiguity with the NSwag client.

Move/rename the tests to avoid ambiguity with an NSwag client.
Add a test that uses an NSwag-generated client.
@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.66%. Comparing base (a15b386) to head (c6532e9).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3689   +/-   ##
=======================================
  Coverage   94.66%   94.66%           
=======================================
  Files         111      111           
  Lines        3861     3861           
  Branches      779      779           
=======================================
  Hits         3655     3655           
  Misses        206      206           
Flag Coverage Δ
Linux 94.66% <ø> (ø)
Windows 94.66% <ø> (ø)
macOS 94.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martincostello martincostello marked this pull request as ready for review November 30, 2025 18:44
Copilot AI review requested due to automatic review settings November 30, 2025 18:44
@martincostello martincostello enabled auto-merge (rebase) November 30, 2025 18:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds NSwag client generation and testing capabilities alongside the existing Kiota client, and reorganizes the test structure to clearly distinguish between the two client types.

  • Adds NSwag as a code generation tool with corresponding test suite
  • Renames Kiota client namespace from TodoApp.Client to TodoApp.KiotaClient for clarity
  • Consolidates client generation into a single script supporting both Kiota and NSwag

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.config/dotnet-tools.json Adds NSwag.ConsoleCore v14.6.3 as a dotnet tool
generate-todo-clients.ps1 New unified script that generates both Kiota and NSwag clients
generate-todo-client.ps1 Removed old Kiota-only generation script
KiotaClientTests.cs New test file containing Kiota client integration tests (moved from CodeGenerationTests.cs)
NSwagClientTests.cs New test file containing NSwag client integration tests
CodeGenerationTests.cs Refactored to only verify generated client snapshots, removing actual API tests
KiotaTodoClient/**/*.cs Updated namespace from TodoApp.Client to TodoApp.KiotaClient
NSwagTodoClient/**/*.cs New NSwag-generated client code in TodoApp.NSwagClient namespace
snapshots/**/*.verified.cs New snapshot files for both Kiota and NSwag generated clients

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


public override string ToString()
{
return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

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

Redundant call to 'ToString' on a String object.

Copilot uses AI. Check for mistakes.

public override string ToString()
{
return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

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

Redundant call to 'ToString' on a String object.

Copilot uses AI. Check for mistakes.
private string _baseUrl;
#pragma warning restore 8618

private System.Net.Http.HttpClient _httpClient;
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

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

Field '_httpClient' can be 'readonly'.

Suggested change
private System.Net.Http.HttpClient _httpClient;
private readonly System.Net.Http.HttpClient _httpClient;

Copilot uses AI. Check for mistakes.
#pragma warning restore 8618

private System.Net.Http.HttpClient _httpClient;
private static System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true);
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

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

Field '_settings' can be 'readonly'.

Suggested change
private static System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true);
private static readonly System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true);

Copilot uses AI. Check for mistakes.
@martincostello martincostello merged commit 73b897c into master Nov 30, 2025
18 checks passed
@martincostello martincostello deleted the nswag-client-tests branch November 30, 2025 18:49
This was referenced Dec 12, 2025
This was referenced Dec 19, 2025
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.

2 participants