Comments (1)
I cant really explain why, but the problem is the "null" in the expectation. Seems NSubstitute cannot figure the right Arg.Is syntax in that case.
If you replace the null with Arg.Is it works:
mock.Received(1).WeirdMethod(Arg.Any<string>(), Arg.Is<string>(v => v == null), Arg.Any<string>(), CancellationToken.None);
from nsubstitute.
Related Issues (20)
- Is there a way of automatically auto generate mocks for a service? HOT 2
- Substitute not called, if argument variable is also out variable HOT 2
- Substiture for ILoggerFactory.CreateLogger<T> HOT 2
- NSubstitute/Castle proxy fail to create substitute that returns a derived class from abstract that satisfies interface implicitly HOT 5
- Return for specific args: Arrays HOT 3
- NSubstitute Received() throws System.NullReferenceException on Grpc mocked call HOT 4
- Generic setup fails with unexpected error message HOT 6
- RobiniaDocs API Explorer HOT 1
- Unable to replace Moq IsAnyType() to Arg.AnyType HOT 1
- `Arg.Any<T>()` behaves strangely when it's stored in a variable instead of being passed directly
- Properties from a substitute object are empty when accessing in a Received.InOrder bloc
- Create a spy of Func<> and make it return a specific value for testing HOT 3
- Compatibility issue with XUnit's `IClassFixture` HOT 2
- Cannot mock an interface method that returns a generic collection with dynamic type HOT 5
- Assertion passes when an argument is used from the substitute itself HOT 1
- Missing/Old explanation in documentation for exception extensions HOT 3
- Customize SubstituteFactory. HOT 3
- Mocked Method returning null? HOT 1
- Compiler error when using Arg.Is<Arg.AnyType> HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsubstitute.