Handle exceptions when asserting an ImmutableArray#1668
Merged
jnyrup merged 1 commit intofluentassertions:masterfrom Sep 10, 2021
eNeRGy164:support-immutablearray
Merged
Handle exceptions when asserting an ImmutableArray#1668jnyrup merged 1 commit intofluentassertions:masterfrom eNeRGy164:support-immutablearray
jnyrup merged 1 commit intofluentassertions:masterfrom
eNeRGy164:support-immutablearray
Conversation
jnyrup
approved these changes
Aug 24, 2021
jnyrup
reviewed
Aug 27, 2021
Member
jnyrup
left a comment
There was a problem hiding this comment.
How do we handle empty vs default instances?
Should they be considered equivalent?
| { | ||
| return ((IEnumerable)value).Cast<object>().ToArray(); | ||
| } | ||
| catch (InvalidOperationException) when (value.GetType().Name.Equals("ImmutableArray`1", StringComparison.Ordinal)) |
Member
There was a problem hiding this comment.
Is it out of habit that you're not using == instead of Equals or am I missing something?
Contributor
Author
There was a problem hiding this comment.
It's probably caused by copy & pasting the suggestion by @Tragedian and changing the StartWith with an exact match.
Member
|
Contributor
Author
I think we can only do this correctly if we take a dependency on the package like @dennisdoomen is suggesting |
dennisdoomen
approved these changes
Sep 10, 2021
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.
Detect specific exceptions with
.ToArray()withImmutableArray<T>.Should fix #1655
IMPORTANT