[Feature]: Extract the object graph comparison engine to a separate package
See original GitHub issueBackground and motivation
- Sometimes with Moq or NSubstitute I need the following call verification logic:
someServiceMock.Verify(s => s.DoSomething(It.Is<object>(o => ObjectComparer.Equals(o, expected))));
I understand and prefer the way with callbacks, as it gives more detailed error messages:
//Arrange
object actual = null;
someServiceMock.Setup(s => s.DoSomething(It.IsAny<object>()))
.Callback<object>(o => actual = o);
// Act ...
// Assert
expected.Should().BeEquivalentTo(actual);
But sometimes it looks overcomplicated. So It would be perfect to have the comparison logic available without assertion.
- Sometimes the fluent assertion approach or library is not approved by the dev team, but the developer who is familiar with fluent assertions would be able to use the comparison feature without referencing the fluent assertion package with a lot of unnecessary extension methods.
PS. I know about the Compare-Net-Objects and ObjectComparer libraries.
Alternative Concerns
No response
Could you help with a pull-request?
No
Issue Analytics
- State:
- Created a month ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Extract compare() into separate package · Issue #447
I'm not sure if diffobj is always a good choice because it'll compare character string representations of objects. But that might be flexible...
Read more >Feature Extraction Techniques
An end to end guide on how to reduce a dataset dimensionality using Feature Extraction Techniques such as: PCA, ICA, LDA, LLE, t-SNE...
Read more >What is Feature Extraction? Feature Extraction in Image ...
In this process they extract the words or the features from a sentence, document, website, etc. and then they classify them into the...
Read more >Image Feature Extraction | Feature Extraction Using Python
Image feature extraction: Learn the process of feature extraction in image processing using different image extraction methods.
Read more >Neo4j - OGM Object Graph Mapper - Developer Guides
Object graph mapping of annotated node- and relationship-entities. Fast class metadata scanning. Optimized management of data loading and change tracking for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just to be clear, upon test failure we detect which testing framework you’re using and throw the appropriate exception. This is done without having a dependency on the testing framework. You can see the dependencies on nuget.org
If you work in a team with such dogmatic believes, you should consider finding a new job. You’re literally stealing from your employer if one refuses to use great tools. And I’m not talking about Fluent Assertions only.
2 and 3 are just there to make 1 better. So this is not something I see any value in. I recommend you check out other examples or fork our code base.