Merged
Conversation
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new MustContain assertion for ImmutableArray<T> to avoid boxing and improve performance when working with immutable arrays in the Light.GuardClauses library.
- Adds two
MustContainextension method overloads forImmutableArray<T>with support for both default and custom exception handling - Includes comprehensive unit tests covering various scenarios including empty arrays, custom exceptions, and custom messages
- Provides documentation detailing the implementation requirements and context for the new feature
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| issue-119-must-contain-for-immutable-array.md | Documentation outlining implementation tasks and requirements for the new feature |
| Check.MustContain.cs | Adds two MustContain extension methods for ImmutableArray<T> with default and custom exception support |
| MustContainTests.cs | Comprehensive unit tests for the new MustContain methods covering edge cases and validation scenarios |
remove duplicate bullet point in plan for issue 119 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #119
This pull request introduces a new
MustContainassertion forImmutableArray<T>to avoid boxing and improve performance when working with immutable arrays in the Light.GuardClauses library. It includes updates to both production code and corresponding unit tests, as well as documentation for the new feature. The most important changes are summarized below.New Feature Implementation:
MustContainextension methods forImmutableArray<T>inCheck.MustContain.cs. The first overload supports optionalparameterNameandmessagearguments and throws aMissingItemExceptionwhen the item is not found. The second overload allows users to specify a custom exception using a delegate.Unit Tests:
MustContain: Added comprehensive unit tests for the newMustContainassertion inMustContainTests.cs. These tests cover scenarios such as the item being present or absent in the array, handling empty arrays, custom exceptions, and custom messages.Documentation:
issue-119-must-contain-for-immutable-array.mddetailing the context, tasks, and notes for implementing theMustContainassertion forImmutableArray<T>. This serves as a guide for contributors and users of the library.Dependency Updates:
Check.MustContain.csandMustContainTests.csto include theSystem.Collections.Immutablenamespace, enabling the use ofImmutableArray<T>. [1] [2]