Message: Expected member Color to be "Blue" with a length of 4, but "Red" has a length of 3.
- Use declared types and members
- Compare enums by name
- Match member by name (or throw)
- Without automatic conversion.
- Be strict about the order of items in byte arrays
Getting back to your issue, I think the failure message can be improved for both ComparingEnumsByName and ComparingEnumsByValue.
Some ideas for the failure message:
Expected member Color to be Color.Blue, but found Color.Red.
Expected member Color to be Blue (1), but found Red (0).
Expected member Color to be Color.Blue (1), but found Color.Red (0).
Including more details is useful if one e.g. compares Color.Red = 0 with AnotherColor.Red = 1 by value.
Only displaying Message: Expected member Color to be Blue, but found Red. would be confusing.