Skip to content

fix(#3): make override the AssertStatus method#5

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

fix(#3): make override the AssertStatus method#5
svmukhin merged 1 commit intomasterfrom
3

Conversation

@svmukhin
Copy link
Owner

@svmukhin svmukhin commented Feb 4, 2026

Closes #3

This pull request adds support for asserting HTTP status codes directly on JsonResponse and XmlResponse objects, enabling more fluent method chaining in tests and response handling. It introduces new AssertStatus methods for both response types and adds corresponding unit tests to verify correct behavior and chaining.

Enhancements to response status assertion:

  • Added a new AssertStatus(int expectedStatus) method to the JsonResponse class, allowing assertions on HTTP status codes and enabling method chaining. (src/SergeiM.Http/Response/JsonResponse.cs)
  • Added a new AssertStatus(int expectedStatus) method to the XmlResponse class, enabling status code assertions and fluent chaining. (src/SergeiM.Http/Response/XmlResponse.cs)

Unit test improvements:

  • Added unit tests for JsonResponse.AssertStatus to verify correct status assertion and method chaining. (src/SergeiM.Http.Tests/JsonResponseTests.cs)
  • Added unit tests for XmlResponse.AssertStatus to confirm status assertion and chaining functionality. (src/SergeiM.Http.Tests/XmlResponseTests.cs)

Make JsonResponse and XmlResponse override the AssertStatus method to return the correct type.
@svmukhin svmukhin merged commit 918b168 into master Feb 4, 2026
5 checks passed
@svmukhin svmukhin deleted the 3 branch February 4, 2026 20:29
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.

JsonResponse not provided AssertStatus method

1 participant