We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to assert that a subtree is contained but that the relative ordering of the items in arrays doesn't matter.
To give an example based on the code from the summary.
using FluentAssertions.Json; void Main() { var json = JToken.Parse("{ id: 1, items: [ { id: 2, type: 'my-type', name: 'Alpha' }, { id: 3, type: 'other-type', name: 'Bravo' } ] }"); json.Should().ContainSubtree(JToken.Parse("{ items: [ { type: 'my-type', name: 'Alpha' }, { name: 'Bravo' } ] }")); json.Should().ContainSubtree(JToken.Parse("{ items: [ { type: 'other-type', name: 'Bravo' }, { name: 'Alpha' } ] }")); }
This gives an error of item[0] is in the wrong order.
I would like to be able to control this behaviour. Eg. have something similar to the options pattern for the main library's BeEquivalentTo?
BeEquivalentTo
actual.Should().BeEquivalentTo(expected, options => options.WithoutStrictOrdering());
The text was updated successfully, but these errors were encountered:
It's a good suggestion.
Sorry, something went wrong.
No branches or pull requests
I want to assert that a subtree is contained but that the relative ordering of the items in arrays doesn't matter.
To give an example based on the code from the summary.
This gives an error of item[0] is in the wrong order.
I would like to be able to control this behaviour. Eg. have something similar to the options pattern for the main library's
BeEquivalentTo
?actual.Should().BeEquivalentTo(expected, options => options.WithoutStrictOrdering());
The text was updated successfully, but these errors were encountered: