Skip to content

Conversation

@jnyrup
Copy link
Member

@jnyrup jnyrup commented May 24, 2021

In 44efddb ShouldExcludeColumn threw an NRE when subjectColumn was null.
This is now null guarded to avoid checking whether a non-existing column should be excluded.
A few lines below subjectColumn and expectationColumn are compared and potential null values are taken into account.

In 03fffcd DataRowCollectionEquivalencyStep.OnHandle did check subject.Count == expectation.Count before invoking MatchRowsByIndexAndCompare which threw an IndexOutOfRangeException, but it didn't take into account being on a continuing AssertionScope.

I also added some more AssertionScope guards to the DataSet related classes in 03fffcd.

This fixes #1530

@jnyrup jnyrup mentioned this pull request May 25, 2021
.FailWith("Expected {context:DataSet} to contain {0}, but found {1} table(s)", expectation.Tables.Count, subject.Tables.Count);

if (dataConfig is not null)
if (success)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 Maybe jumping out of the method when success is false may make this method better readable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in an early return?
I would be happy to do that instead, I only avoided it for your sake.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, it would make total sense.

@jnyrup jnyrup merged commit dae4443 into fluentassertions:develop May 26, 2021
@jnyrup jnyrup deleted the Issue1530 branch May 26, 2021 18:18
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.

Exceptions from DataSet Assertions

2 participants