Reputation: 5027
Given an async method, how can NSubstitute check a call was not received?
With NSubstitute, we can check a async method (or many) were received in order using:
Received.InOrder(async () =>
{
await client.SendAsync(Arg.Any<string>())
});
What is the equivalent for DidNotReceive
?
Upvotes: 6
Views: 2630
Reputation: 5027
I created/answered my own question here because I found this unintuitive in NSubstitute.
await client.DidNotReceive().SendAsync(Arg.Any<string>());
Upvotes: 7