-
Notifications
You must be signed in to change notification settings - Fork 731
Improved reporting of properties and field details in the equivalency API #1379
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
Improved reporting of properties and field details in the equivalency API #1379
Conversation
| Subject = context.Subject | ||
| }; | ||
|
|
||
| adjustedCopy.SelectedMember.Path = CollectionMemberMemberInfo.GetAdjustedPropertyPath(context.SelectedMember.Path); |
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.
Should the Description also still be set?
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.
Ah yes.. No, it's a weird piece of code. It did not update the description at all (which is what Clone does right now). I've added to the bullet list in this PR to see what it really tries to do.
721a1d1 to
b632fc5
Compare
bea6ba3 to
87aaed7
Compare
042ae8a to
8594916
Compare
9ca026f to
7776cd3
Compare
63cff70 to
67d6d33
Compare
673552c to
88f9c84
Compare
21e00e5 to
8763de7
Compare
202fb5a to
be1e444
Compare
Src/FluentAssertions/Equivalency/Selection/ExcludeMemberByPathSelectionRule.cs
Outdated
Show resolved
Hide resolved
Sorry, did not notice that you already reviewed it. |
99ee786 to
4e8994d
Compare
Src/FluentAssertions/Equivalency/EquivalencyValidationContext.cs
Outdated
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Equivalency/BasicEquivalencySpecs.cs
Outdated
Show resolved
Hide resolved
|
These two now removed class names gave me a good laugh
|
4e8994d to
588f089
Compare
588f089 to
5f75642
Compare
… API The equivalency assertions will now include the type of the member and whether it involves a field or property. This required significant refactorings: * The properties of `IEquivalencyValidationContext` have been combined into the `INode` hierarchy and the two `Reason` and `Tracer` classes * Moved a lot of logic related to the object graph location into the `Node`, `Field` and `Property` classes. * The `SelectedMemberInfo` class has been removed, since it main user, `IMemberInfo` has been flattened. * Several methods that took an `IMemberInfo`, but could also act on other objects than a property or field now take an `IObjectInfo`
5f75642 to
cc10ae7
Compare
* Update dependency FluentAssertions to v6 * Fix issues caused by major version update in fluent assertions library changes seen here - fluentassertions/fluentassertions#1379 Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Jordan Western <j.western@tricentis.com> Co-authored-by: Aslak Hellesøy <1000+aslakhellesoy@users.noreply.github.com> Co-authored-by: Aurélien Reeves <aurelien.reeves@smartbear.com>
* Update dependency FluentAssertions to v6 * Fix issues caused by major version update in fluent assertions library changes seen here - fluentassertions/fluentassertions#1379 Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Jordan Western <j.western@tricentis.com> Co-authored-by: Aslak Hellesøy <1000+aslakhellesoy@users.noreply.github.com> Co-authored-by: Aurélien Reeves <aurelien.reeves@smartbear.com>
The equivalency assertions will now include the type of the member and whether it involves a field or property.
This required significant refactorings:
IEquivalencyValidationContexthave been combined into theINodehierarchy and the twoReasonandTracerclassesNode,FieldandPropertyclasses.SelectedMemberInfoclass has been removed, since it main user,IMemberInfohas been flattened.IMemberInfo, but could also act on other objects than a property or field now take anIObjectInfoBecause the final design evolved while doing the refactorings, I had to give up on nice and clean commits.
IMember, Field and PropertyIMemberRootIsCollectionfromIEquivalencyValidationContextIsRootintoIMemberCollectionMemberAssertionRuleDecorator.IEquivalencyValidationContextinherit fromIMemberInfoINode.Pathhas no publicsetterEquivalencyValidationContext.AsNestedMemberIMemberproperties into more functional methodsIMemberreally needGetValueand the access modifier getters?INode.Descriptionfrom its state instead of setting it externallyTracer.WriteLineneeds to rewrite the pathINode.Clonereally necessaryWithoutInitialIndexQualifier?Follow-up PR
GetExpectationTypecalculation intoIEquivalencyContext.ExpectedType.