Most Assert methods takes an optional userMessage parameter, but Assert.Null and Assert.NotNull doesn't.
Actually, you'll find only .True and .False take user messages. This is a purposeful choice, and not currently open for debate.
This is the definitive thread with our reasoning: https://github.com/xunit/xunit/issues/350
Thanks. I'll close this then. I do heavily disagree though. This isn't about self-documenting tests, but about daily test reports. You could have two of the same asserts in a test, and not know which one failed until you re-run the test. Getting a daily report with a more specific message about what failed, means you can often instantly assign it for triage to the correct person, because you know much better what exactly broke.
There is a solution if someone still needs it (https://stackoverflow.com/a/52973715/1143349).
I need it as I test localization resources and need to return the key which fails. If someone can explain why should I not add a key to the failed test message?
Most helpful comment
Thanks. I'll close this then. I do heavily disagree though. This isn't about self-documenting tests, but about daily test reports. You could have two of the same asserts in a test, and not know which one failed until you re-run the test. Getting a daily report with a more specific message about what failed, means you can often instantly assign it for triage to the correct person, because you know much better what exactly broke.