python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How do I inject dependencies in Moq testing without the interface on the constructor of the service?
I'm trying to create a Moq test project but I cannot inject the dependencies on the service/interface because my service constructor doesn't have an interface argument.
Service constructor:
public Nea...
suntunutuxx
Votes: 0
Answers: 1
Mock ProtectedSessionStorage for Blazor
Is there a way to Mock ProtectedSessionStorage in a Blazor Server Side project?
I tried below code but I am getting error : "Type to mock (ProtectedSessionStorage) must be an interface, a delegat...
harry777
Votes: 0
Answers: 1
Controller returns a null IActionResult when running xUnit test
I'm having some difficulties making my unit test pass.
This is my unit test class:
[Collection(nameof(VehicleControllerCollection))]
public class DetectVin
{
private readonly VehicleControllerFixt...
Nicholas Magnussen
Votes: 0
Answers: 1
How to mock the mongodb Fluent Aggregate?
Below is the sample code I would like to mock the fluent result using Moq.
database.GetCollection(nameof(Collection)).Aggregate().
Match(x => x.IsActive)
.Unwind(x => x.PersonalDetails, new Aggr...
Sudhesh Gnanasekaran
Votes: 0
Answers: 0