NSubstitute icon indicating copy to clipboard operation
NSubstitute copied to clipboard

A friendly substitute for .NET mocking libraries.

Results 178 NSubstitute issues
Sort by recently updated
recently updated
newest added

**Describe the bug** I get the following exception, the expected does not fit my argument definition: ``` NSubstitute.Exceptions.ReceivedCallsException : Expected to receive exactly 1 call matching: WeirdMethod(any String, any String,...

bug

**Describe the bug** Get an exception when mocking an interface method that returns a generic collection with a dynamic type. **To Reproduce** The code below cannot execute without throwing an...

**Describe the bug** When passing a parameter from the substitute itself to a (received) assertion it passes although it clearly shouldn't. **To Reproduce** ``` public interface ICandidate { string Name...

bug

I miss the explanation of throwing exceptions with the ExceptionExtensions class in the documentation. There is only the example with `Returns(x => {throw new Exeption(); });` Would be good if...

**Question** Hi all, Been bashing my head against a desk on this one, cannot seem to figure it out. Essentially I have a method that takes in a `Func`. I...

**Describe the bug** Properties from a substitute object are empty when accessing in a Received.InOrder bloc. It will be clear checking the tests below. **To Reproduce** This is the simplest...

bug

**Describe the bug** The effect of `Arg.Any()` depends on whether it's stored in a variable or passed directly. **To Reproduce** ```csharp public interface INumberChecker { public bool Exists(int num); }...

Maybe You will be interested in hosting API Explorer online: https://www.robiniadocs.com/d/nsubstitute/api/NSubstitute.Arg.html This is ready-to-go, so above link can be added to README.md for other people to see it. Or using...

repo example https://github.com/JosimarTT/NSubstitute-GrpcClient-TestFail I'm migrating from Moq to Nsubstitute and faced this problem. In Moq I have an unit test to verify that the grpc method was called once. Moving...

**Describe the bug** Trying to configure/override a generic overridden virtual method with an out parameter on a class substitute throws an exception. ``` System.ArgumentException : Could not find method overriding...

help wanted