Skip to content
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

Make JTokenDifferentiator an instance class #63

Merged
merged 1 commit into from
Feb 26, 2022

Conversation

jnyrup
Copy link
Member

@jnyrup jnyrup commented Feb 26, 2022

Make JTokenDifferentiator an instance class to reduce the number of arguments passed around.

@@ -74,7 +82,7 @@ private static Difference CompareExpectedItems(JArray actual, JArray expected, J
bool match = false;
for (int actualIndex = matchingIndex; actualIndex < actualChildren.Length; actualIndex++)
{
var difference = FindFirstDifference(actualChildren[actualIndex], expectedChild, true, config);
Copy link
Member Author

Choose a reason for hiding this comment

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

CompareExpectedItems is only called when ignoreExtraProperties is true, so the three true literals in this method always corresponds to the value of ignoreExtraProperties.

@@ -117,8 +124,7 @@ private static Difference CompareExpectedItems(JArray actual, JArray expected, J

for (int i = 0; i < actualChildren.Length; i++)
{
Difference firstDifference = FindFirstDifference(actualChildren[i], expectedChildren[i],
path.AddIndex(i), false, config);
Copy link
Member Author

Choose a reason for hiding this comment

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

CompareItems is only called when ignoreExtraProperties is false.

@coveralls
Copy link

coveralls commented Feb 26, 2022

Pull Request Test Coverage Report for Build 1903789818

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 90.164%

Totals Coverage Status
Change from base Build 1900756004: 0.03%
Covered Lines: 174
Relevant Lines: 179

💛 - Coveralls

@jnyrup jnyrup merged commit 600b0af into fluentassertions:master Feb 26, 2022
@jnyrup jnyrup deleted the JTokenDifferentiator branch February 26, 2022 18:24
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.

None yet

3 participants