Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

New Post: IncludingNestedObjects and SharedProperties

$
0
0

I'm currently trying to use the PropertyAssertions to compare the values exposed by an interface hierarchy to a hierarch of anonymous types.  I want to be able to only compare the properties that are defined in the anonymous types using the SharedProperties method to set the OnlySharedProperties object on the PropertyEqualityValidator.  It works fine for the first level, but once it goes to the next level of the hierarchy, the OnlySharedProperties is no longer set.

It looks like when the CompareIncompatibleProperties method is called, that a child validator is created and all public properties are added to the child validator instead of only the shared properties.  Is this the expected behavior and am I taking the proper approach to compare hierarchies?

I really like what you've done with the PropertyAssertions and the IncludingNestedObjects method, it allows very clear unit tests and I'd like to continue using it.

Thanks,
Chris


Viewing all articles
Browse latest Browse all 1402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>