You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was playing around with this idea today. I imagine it's a pretty common pattern to have enums for common things you might only have an int value for on say a db entity. This makes debugging the issue much easier as you get the enum member name on the end of the custom message.
It may be possible to have this wrap an enum.ShouldBe(enum) method too, but haven't played around with that yet. It might offer a better output upfront.
This could also be extended to byte, short, etc I guess.
Usage
enumStatus{Active,Inactive}varstatusId= sut.GetStatus(foo);
statusId.ShouldBe(StatusEnum.Active,"Has x, should be active");
Output
Message:
Shouldly.ShouldAssertException : actual
should be
0
but was
1
Additional Info:
Has x, should be active (Expected: Active Actual: Inactive).
Was playing around with this idea today. I imagine it's a pretty common pattern to have enums for common things you might only have an int value for on say a db entity. This makes debugging the issue much easier as you get the enum member name on the end of the custom message.
It may be possible to have this wrap an enum.ShouldBe(enum) method too, but haven't played around with that yet. It might offer a better output upfront.
This could also be extended to byte, short, etc I guess.
Usage
Output
Impl
The text was updated successfully, but these errors were encountered: