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

Let's collect improvements we could/should make in our next major versions and are not allowed to apply now because of SemVer. Issue might be updated. - [ ] Make `RouteAction`...

I realize this might be a big ask but would it be possible to release a new 4.x version with a more recent version of `System.Threading.Tasks.Extensions`? This will make consuming...

I write a unit test, in the test I want to test my `CashCapitalService`. in my service, I used `AutoMapper` for mapping my model to dto and reverse. My Service...

The default return value for string is `""` and for integers it is `0`. These are very reasonable defaults, but is it possible to change it for recursive mocks without...

This is unusual and I have no idea what's going on. When attempting to mock `TryGetValue` in `httpContext.Request.Cookies`: ```C# [TestMethod] public void Test() { var httpContext = new DefaultHttpContext(); httpContext.Request.Cookies...

This is a weird one and very specific to the `Azure.Storage.Blobs.BlobContainerClient`. When using version `12.6.0`, the following works: ```cs // Using Azure.Storage.Blobs version 12.6.0 interface IClientWrapper { public BlobContainerClient GetBlobContainerClient();...

This is more a question rather than a bug report. Inspired by a question on [SO](http://stackoverflow.com/questions/23629719/can-nsubstitute-be-set-up-to-execute-any-passed-delegate) Suppose we have an interface with a generic method: ``` csharp public interface IInterfaceWithGenericMethod...

From https://github.com/nsubstitute/NSubstitute/issues/152#issuecomment-739048514: > Stumbled upon this while attempting to validate a call into `Microsoft.Extensions.Logging.ILogger`. > > The logger interface takes a `T` state, but the "public" APIs (i.e. common extension...

feature-request

I'm using NSubstitute (in conjunction with AutoFixture) to auto-mock service interfaces. Consider the following example ``` interface ISomeDependency { object MethodA(); object MethodB(); object MethodC(); } class SomeClass { public...

As per [this SO comment](https://stackoverflow.com/questions/55237428/how-to-configure-nsubstitute-not-call-internal-virtual-method/55239045?noredirect=1#comment113698526_55239045), the [How NSub Works](https://nsubstitute.github.io/help/how-nsub-works/) docs are incorrect. > Use `[assembly: InternalsVisibleTo(InternalsVisible.ToDynamicProxyGenAssembly2)]` in the test assembly so that the internal member can be overridden. should be:...

documentation