Using Should().BeEquivalentTo()
I want to compare 2 objects which contain a series of key-value pairs but to exclude the actual value of the keys because that will vary. So basically I'm only interested in comparing the contents of the Values.
Example:
MyObject { MyDictionary1 { Key, Value } ... MyDictionary2 { Key, Value } }
compared to
ExpecterdObject { ExpectedDictionary1 { Key, Value } ... ExpectedDictionary2 { Key, Value } }
The 2 objects being of the same class with the same structure but with each instance having unique ids as keys.
I already tried
.Excluding(e => e.KayValuePair.Keys)
which doesn't seem to work as I still get errors saying that
Expected member MyDictionary1 to be a collection with 3 item(s). Expected member MyDictionary1 to contain key X.