In NSubstitute, is it possible to specify a message that should be thrown if a Received fails? Something like the following:
[Test]
public void Should_execute_command()
{
var command = Substitute.For<ICommand>();
var something = new SomethingThatNeedsACommand(command);
something.DoSomething();
command.Received()
.Execute()
.Because("We should have executed the command that was passed in");
}
For comparison, in Moq, you can do this:
command.Verify(c => c.Execute, "We should have executed the command that was passed in");
And then you get that message as part of the test failure message in your test runner. This can help to make test failures easier to read/diagnose. Is there anything similar in NSubstitute?