Skip to content

Develop#5

Merged
coderynx merged 2 commits intomainfrom
develop
Sep 5, 2025
Merged

Develop#5
coderynx merged 2 commits intomainfrom
develop

Conversation

@coderynx
Copy link
Owner

@coderynx coderynx commented Sep 5, 2025

This pull request introduces a new test project for the Coderynx.Functional.WebApi package and improves the handling of HTTP results for functional result types. It adds comprehensive unit tests for both Result and Option extension methods, fixes a logic bug in the result-to-HTTP mapping, and ensures proper HTTP status codes and problem details are returned for different error kinds. The package version is also incremented for release.

Testing and Project Structure:

  • Added a new test project Coderynx.Functional.WebApi.Tests targeting .NET 9, including dependencies for xUnit and code coverage, and registered it in the solution file. [1] [2]
  • Implemented extensive unit tests for ResultExtensions and OptionExtensions, covering all major success and error scenarios for HTTP result mapping. [1] [2]

Bug Fixes and Improvements in HTTP Result Mapping:

  • Fixed a logic bug in ToHttpResult<TValue> where the check for result.Value was inverted, ensuring correct HTTP responses for null and non-null values.
  • Improved error handling by mapping ErrorKind.InvalidInput to the appropriate RFC link and HTTP 400 status code in problem responses. [1] [2]

Versioning:

  • Bumped the package version from 1.4.1 to 1.4.2 to reflect these changes.

…pdate `ResultExtensions` logic, and introduce test project for WebApi functionality
@coderynx coderynx merged commit 2d97c08 into main Sep 5, 2025
2 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