-
Notifications
You must be signed in to change notification settings - Fork 731
Add Have/NotHaveSameCount for Dictionaries #1178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| { | ||
| Guard.ThrowIfArgumentIsNull(otherCollection, nameof(otherCollection), "Cannot compare dictionary count against a <null> collection."); | ||
|
|
||
| if (ReferenceEquals(Subject, null)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering using is null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is null isn't used in CollectionAssertions.HaveSameCount is because TSubject is not constrained to reference types and is null can only be used on reference types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarQube keeps telling me (in another project) to compare to default(T) ;-)
|
If there are no other concerns, what's the process for getting this merged? |
|
@veleek Could I ask you to change the two |
Use `is null` instead of `ReferenceEquals(..., null)`.
|
@veleek Thanks for the contribution! |
Indeed. Another nice little gem. |
Adding support for
HaveSameCountandNotHaveSameCountfor dictionaries. This was almost directly cribbed from the existingCollectionAssertions(including test cases).Resolves #1176
IMPORTANT