Test your NSubstitute knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/12Score 0
How would a test using NSubstitute typically verify that a method was called with an argument matching a specific object's properties, without needing that argument to be the EXACT same object reference?
In this round
How would a test using NSubstitute typically verify that a method was called with an argument matching a specific object's properties, without needing that argument to be the EXACT same object reference?
What is `Arg.Is<T>()` used for as a more specific alternative to `Arg.Any<T>()` in NSubstitute?
What is the significance of NSubstitute (like other .NET mocking libraries) being commonly paired with dependency injection as a design pattern in the code under test?
What is the basic syntax for creating a substitute of an interface with NSubstitute?
What is the significance of NSubstitute requiring the mocked member to be an interface member, or a virtual/abstract class member -- similar to the constraint other .NET mocking libraries like Moq share?
How does NSubstitute handle mocking async methods (returning `Task<T>`)?
What is a reasonable justification for a test explicitly using `DidNotReceive()` to verify a negative outcome, rather than simply not writing any verification for that interaction at all?
What is the purpose of `Received(n)` (with a specific call count argument) in NSubstitute, as opposed to plain `Received()`?
How do you configure a substitute's method to return a specific value in NSubstitute?
What is a reasonable strategy for choosing which mocking library (NSubstitute vs. Moq) a .NET team should adopt for a new project?