Top "Nsubstitute" questions

NSubstitute is a .NET mocking framework.

Is it recommended to mock concrete class?

Most of the examples given in mocking framework website is to mock Interface. Let say NSubstitute that I'm currently using, …

c# unit-testing mocking nsubstitute
Can I get NSubstitute to auto mock my concrete classes?

I have an interface which I am mocking with 'NSubstitute' which contains properties that return concreate classes, that is the …

nsubstitute
NSubstitute: Checking received methods with array arguments

I want to verify that a method on my NSubstitute mock is called with a particular array argument. Say the …

c# nsubstitute
NSubstitute DbSet / IQueryable<T>

So EntityFramework 6 is a lot better testable then previous versions. And there are some nice examples on the internet for …

c# entity-framework dbcontext nsubstitute dbset
NSubstitute - mock throwing an exception in method returning Task

Using NSubstitute, how do you mock an exception being thrown in a method returning a Task? Let's say our method …

c# .net asynchronous task nsubstitute
NSubstitute mock extension method

I want to do mock extension method, but it does not work. How can this be done? public static class …

c# random mocking nsubstitute
What are NSubstitute limitations, specially vs MOQ?

I'm about to take a decision about the mocking library for my next project. and because I'm new to those …

.net unit-testing tdd moq nsubstitute
NSubstitute - Received for async - “call is not awaited”warning

I am trying to verify that an asynchronous method was called with the correct parameters. However, I get the warning: "…

c# unit-testing asynchronous async-await nsubstitute
Check calls Received() for async method

When I run the following code: [Test] public async Task Can_Test_Update() { var response = await _controller.UpdateAsync(Guid.NewGuid()); …

c# asynchronous async-await nsubstitute
how to mock a property with private setter using NSubstitute

I am having a class "Example" with a property "data" which has a private setter and I would like to …

c# private nsubstitute