Skip to content

Detailed message for graph comparison of C# 9 records #1451

@Cherepoc

Description

@Cherepoc

Hi!
When used with regular classes, comparing two different objects yields a message detailing what exactly is different, like in my case:

Expected member WorkingHoursJson to be <null>, but found 
"[{"dayOfWeek": "friday", "latestTime": 120, "earliestTime": 60}]"

When I make that class a record, those details are lost, and both objects are just dumped into message:
Expected createdBusiness to be BusinessDto { Id = 1, Name = Halvorson - Orn, CreatedAt = 12.09.2020 13:47:54, UpdatedAt = 12.09.2020 13:47:54, EnableA...
...and so on. Is there a way to get detailed messages for records?
Thanks!

EDIT: found ComparingByMembers option, this solves the problem. But I think it would be better to compare records by members by default.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions