Test your NSubstitute knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/5Score 0
What is the basic syntax for creating a substitute of an interface with NSubstitute?
Questions in this quiz
What is the basic syntax for creating a substitute of an interface with NSubstitute?
How does NSubstitute handle mocking async methods (returning `Task<T>`)?
How do you configure a substitute's method to return a specific value in NSubstitute?
What is the purpose of NSubstitute's support for configuring a sequence of DIFFERENT return values across multiple calls to the same method?
What does the term "substitute" specifically emphasize about NSubstitute's naming/design philosophy, compared to the more common industry term "mock"?
What is NSubstitute?
How would you configure an NSubstitute substitute to throw an exception when a method is called, to test error-handling logic?
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 a reasonable comparison between NSubstitute's syntax philosophy and Moq's, given that both are popular .NET mocking libraries solving the same underlying problem?
How does NSubstitute support configuring a substitute's property (rather than a method) to return a specific value?
How do you verify that a specific method was called on an NSubstitute substitute?
What is `Arg.Is<T>()` used for as a more specific alternative to `Arg.Any<T>()` in NSubstitute?