-
Notifications
You must be signed in to change notification settings - Fork 731
Add NotContainInOrder #1339
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
Add NotContainInOrder #1339
Conversation
|
I'm occupied all weekend, but I'll try to have a look at this Monday or Tuesday |
| { | ||
| Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify absence of ordered containment against a <null> collection."); | ||
|
|
||
| Execute.Assertion |
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.
If somebody uses an AssertionScope, FailWith will not throw immediately and return a bool
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.
Does that mean we should also return from the method if subject 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.
That has nothing to do with my comment. What I meant is that you need to avoid executing the remainder of that method if the first FailWith returns false.
If the subject itself is null, it should also fail the assertion.
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.
Pushed changes for this case, please check if that does what you expect it to.
…hen the subject is null
jnyrup
left a comment
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.
Finally I understand what this is about.
Ensuring that the subject does not contain an unexpected subsequence
Yes, that put me off-guard a couple of times as well. |
This PR adds
NotContainInOrderassertion as requested in #318.IMPORTANT
AcceptApiChanges.ps1/AcceptApiChanges.sh.