Skip to content

Conversation

@rynkevich
Copy link
Contributor

This PR adds NotContainInOrder assertion as requested in #318.

IMPORTANT

  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used in this example.
  • If the contribution adds a feature or fixes a bug, please update the release notes, which are published on the website.
  • If the contribution changes the public API the changes needs to be included by running AcceptApiChanges.ps1/AcceptApiChanges.sh.
  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.

@jnyrup
Copy link
Member

jnyrup commented May 29, 2020

I'm occupied all weekend, but I'll try to have a look at this Monday or Tuesday

@rynkevich rynkevich requested a review from dennisdoomen May 30, 2020 15:35
{
Guard.ThrowIfArgumentIsNull(unexpected, nameof(unexpected), "Cannot verify absence of ordered containment against a <null> collection.");

Execute.Assertion
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

@rynkevich rynkevich requested a review from dennisdoomen June 1, 2020 16:26
@dennisdoomen dennisdoomen requested a review from jnyrup June 1, 2020 18:10
Copy link
Member

@jnyrup jnyrup left a 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

@dennisdoomen
Copy link
Member

Ensuring that the subject does not contain an unexpected subsequence

Yes, that put me off-guard a couple of times as well.

@dennisdoomen dennisdoomen merged commit aca9afb into fluentassertions:develop Jun 6, 2020
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.

3 participants