Skip to content

fix(#4): rename the string overload: Use WithUri(string)#6

Merged
svmukhin merged 1 commit intomasterfrom
4
Feb 4, 2026
Merged

fix(#4): rename the string overload: Use WithUri(string)#6
svmukhin merged 1 commit intomasterfrom
4

Conversation

@svmukhin
Copy link
Owner

@svmukhin svmukhin commented Feb 4, 2026

Closes #4

This pull request refactors how the base URI is set on requests by replacing the Uri(string uri) method with a new WithUri(string uri) method across the codebase. This change clarifies intent and improves the API's expressiveness. The update is reflected in the interface, implementation, and related usage, and is accompanied by new tests to verify the behavior.

API changes:

  • Replaced the Uri(string uri) method with WithUri(string uri) in the IRequest interface, including updated XML documentation to clarify its purpose.
  • Updated the implementation in BaseRequest to provide the new WithUri(string uri) method, replacing the old method.

Usage updates:

  • Modified UriBuilder so that the Back() method now uses WithUri(Build()) instead of the removed Uri(string uri).

Testing improvements:

  • Added two new tests: one to ensure WithUri returns a new request, and another to verify that further URI building after WithUri works as expected.

1. IRequest.cs:

   - Removed IUriBuilder Uri(string uri)
   - Added IRequest WithUri(string uri) for clarity

2. BaseRequest.cs:

   - Made WithUri(string) public (implementing IRequest)
   - Removed Uri(string) override

3. UriBuilder.cs: Updated Back() to call _request.WithUri(Build())

4. RequestTests.cs: Updated tests to use WithUri instead of Uri(string)
@svmukhin svmukhin merged commit fa79af0 into master Feb 4, 2026
5 checks passed
@svmukhin svmukhin deleted the 4 branch February 4, 2026 20:54
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.

Inconsistent return types in IRequest.Uri() method overloads

1 participant