NSubstitute
NSubstitute copied to clipboard
A friendly substitute for .NET mocking libraries.
**Mock Microsoft.Extensions.Logging in .Net core 3** Following code is working in .Net core 2.2 but .Net Core 3 **Environments** - Microsoft.Extensions.Logging Version="3.0.0" - NSubstitute Version="4.2.1" - Xunit "2.4.0" ***Domain Class***...
When mocking e.g. a repository with e.g. a `Store(T entity)` method, it would be nice to be able to write code like this, to verify that `Store` was called with...
**Describe the bug** I get compiler error: > The type 'bool?' must be a reference type in order to use it as parameter 'T' in the generic type or method...
**Describe the bug** I'm attempting to update NSubstitute V4.0.0 -> V4.2.2 and am seeing a test fail that did not previously. A call to 'Received.InOrder' is failing to detect a...
Builds of tagged commits on AppVeyer should use GitHub Release storage. * [Publishing artifacts to GitHub Releases](https://www.appveyor.com/docs/deployment/github/) * [AppVeyer artifacts rentention](https://www.appveyor.com/docs/packaging-artifacts/#artifacts-retention-policy) Artifacts should be published as Draft releases so we...
Hi, The question comes from asp net core integration test, lets say I've got a IDistributedCache with an in-memory implementation registered for unit tests purpose. I would like to have...
As suggested in https://github.com/nsubstitute/NSubstitute/issues/443#issuecomment-415327557, it could be useful to expand the information presented in the `CallSequenceNotFoundException` thrown from `Received.InOrder`. Possibly something like this: ``` Expected to receive these calls in...
Create CallInfo to calls that return results and expose `GetBaseResult`. This gets messy to push the generic all the way through the code, so am just using a cast in...
**Is your feature request related to a problem? Please describe.** I frequently switch between NSubstitute and Moq depending on which project I'm working on. It's quite easy, to get the...
Hi, I'm trying to use Argument Matcher in Received.InOrder, but the unit test result window didn't show the wrong argument as they do outside Received.InOrder. Is there any way to...