How to implement XUnit descriptive Assert message?

Use the suggestions provided at the link. Like fluent assertions or create your own assertion that wraps the Assert.True or Assert.False which were left with their message overloads.
It was mentioned further down

Quote

You can provide messages to Assert.True and .False. If you simply
cannot live without messages (and refuse to use a different
assertion), you could always fall back to:

Assert.True(number == 2, "This is my message");

Quote:

If you really want to have messages you could add Fluent
Assertions or maybe
xbehave
to your test projects and use their syntax.
Fluent Assertions even throws xunit.net exceptions if it encounters its presence.

Leave a Comment