NSubstitute
NSubstitute copied to clipboard
A friendly substitute for .NET mocking libraries.
Hi! I'm trying to create some helper methods to make working with NSubstitute more and more convenient. There is a case, when I need to check how many or which...
Using expression trees instead of simple lambda's in `Arg.Is` is less than ideal. For example, `Arg.Is(x => x?.Length == 0)` is not allowed because expression trees cannot contain null propagating...
Referencing issue #98... While doing something like `stuffDoer.Calculate().Returns(42).AndCalls(x => blah());` works, it is would make a lot more sense to be able to do something like `stuffDoer.Calculate(something).Do(x => { }).Returns(42);`...
Hello everybody! why is an empty object returned the first time? Please explain to me ``` using NSubstitute; using System.Net; using System.Reflection; using Xunit; using Assert = Xunit.Assert; namespace RepositoryServiceTests...
changes: - [Breaking Change] Update target frameworks: .NET 8, .NET Standard 2.0 - Drop EOL .NET 6/7 platforms from testing matrix - Update github actions steps versions - [Breaking Change]...
I propose to implement changes in following areas for the next major release: Infrastructure: - [x] Update tfm list: net8.0 + netstandard2.0 (https://github.com/nsubstitute/NSubstitute/pull/831) - [x] Drop EOL .NET 6 and...
**Describe the bug** Argument matchers for generic `out` parameters fail for derived methods where the `out` is a derived type and `null` is passed in. (The reproduce code should make...
**Question** If you create a Substitute for a type via `Substitute.For()`, you can detect if the instance is a substitute by checking if `myInstance is ICallRouterProvider` (as per https://github.com/nsubstitute/NSubstitute/issues/659). However,...
- move `/docs` to `/help` - remove dates from doc names - move docs to sub-directories and rename to index.md so we get nice urls (e.g. `help/example` rather than `help/example.html`....
Hi everybody, I was wondering if there's an estimated release date for the next NSubstitute version. We're relying on [PR #808](https://github.com/nsubstitute/NSubstitute/pull/808), and would prefer to use an official release rather...