Skip to content

Conversation

@trippwill
Copy link
Member

Updated the Opt class in Opt.cs to include XML documentation for the From method, which now supports both nullable value types and non-nullable reference types. Converted Zip and Flatten methods to extension methods. Changed the constructor of Opt<T> to internal and modified the Select method to accept functions returning nullable types. Added a new Where method for filtering options based on predicates.

In OptTests.cs, added unit tests for the Select and Where methods, covering value transformations, null handling, and behavior when the option is None. Included additional tests for casting options to validate correct and incorrect casts.

Updated the `Opt` class in `Opt.cs` to include XML documentation for the `From` method, which now supports both nullable value types and non-nullable reference types. Converted `Zip` and `Flatten` methods to extension methods. Changed the constructor of `Opt<T>` to internal and modified the `Select` method to accept functions returning nullable types. Added a new `Where` method for filtering options based on predicates.

In `OptTests.cs`, added unit tests for the `Select` and `Where` methods, covering value transformations, null handling, and behavior when the option is `None`. Included additional tests for casting options to validate correct and incorrect casts.
@trippwill trippwill closed this Jan 3, 2025
@codecov
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/libanvl.Opt/Opt.cs 77.77% 0 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
src/libanvl.Opt/Opt.cs 67.10% <77.77%> (+0.43%) ⬆️

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