0909EM
0909EM

Reputation: 5027

NSubstitute: Checking DidNotReceive async method

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

Answers (1)

0909EM
0909EM

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

Related Questions