I have a method that calls azure API to list blobs from a given container. Then I have some business logic (mostly based on their names) and then this ...
I have a method that calls azure API to list blobs from a given container. Then I have some business logic (mostly based on their names) and then this ...
Possibly stupid question. In the docs they give this example Am I testing that the actual calculator returns 3 or just that the substitute does? If ...
I am using Polly's retry policy for my unsuccessful call. But it is not catching the exception and retrying. Using: Polly 7.2.3 .NET6.0 Nsu ...
Using xunit, Autofixture and NSubstitute I have a class MyClass depends on IServiceB which in turn depends on IServiceA like below Then I have bel ...
While using the NuGet NSubstitute 4.3.0 and NSubstitute.Analyzers.CSharp, I am trying to intercept a call as follows. Here actual names are changed ...
In my library I have a simple class: public class FormDataJsonBinderProvider : IModelBinderProvider { // code ommited public IModelBinder G ...
I have a following class called TestClass and has one function. In TestClass This is How I am trying to mock the method above using NSubstitute. ...
I have a customer class which accepts an IDbGateway interface as a constructor parameter. I need to write a unit test CalculateWage_HourlyPayed_Return ...
I'm writing my unit tests for my application and I'm trying to make sure that an exception is throw in one of my services. That exception is throw bas ...
I'm using azure blob container to download container content and do some stuff, here is my code: public async Task<IEnumerable<MyData>> R ...
I have the following interface to perform mocking: public interface IIOManager { void WriteAllText(string fullPath, string aFileContents); st ...
I have a client interface that looks like this: public interface IDiscosClient { public Task<DiscosResponse<T>?> Get<T>(string ...
I have a public method ValidateWords inside FooService.To test the ValidateWord method, I created IAppSettingWrapper and AppSettingWrapper which retur ...
I have been trying to mock a function that included optional parameters with fixed parameters but every time I am getting a null value here is my func ...
My test requires that I have different counts of objects in an IEnumerable property of the main entity collection. I have been searching for documenta ...
I have a subclass that overrides a method: public class Parent { public virtual string Foo(string s) { //... } } public class Child : Parent ...
I try to Arrange a factory to return a service instance. And then I arrange this service , however the method in the service always return null, even ...
I started using xUnit and NSubstitute for my unit tests. I want to mock the following method. I attempted it but couldn't get it to work. My curren ...
Consider this type that is outside my control: public class Foo { public Foo(IBar bar) : base(bar) { // <---- here's ...
I want to test a class that depends on another class with the virtual method. Now I want to test the HostClass with Autofixture + NSubstitute. My e ...