python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Parameter count mismatch Exception when mocking HttpClient in F#
I'm trying to mock the .NET HttpClient with Moq in F#. I currently have the following code:
open System.Net.Http
open Foq
[<Fact>]
let ``Some test`` () =
Mock<HttpClient>.With
...

Roald
Votes: 0
Answers: 1
HTTPClientFactory MOQ testing cancellationToken is true when running in normal, but when executing unit test case cancelation token is false
I am trying to make an PostAsync call using IHttpClientFactory , The cancellation token is working fine and exception is caught by CatchBlock.
But when trying to mock the method the Cancellation token...

Rupesh
Votes: 0
Answers: 1
xUnit, Moq with UnitOfWork and general repository
I tried a lot of examples but I do not get the good response.
The ReportUpload method creates some Report entity based on the list from ExcelManager list
and adds them to the Reports DbSet.
My goal wo...
sada
Votes: 0
Answers: 1
Mocking a method with a side effect on its argument
I've got a method in SomeRepository that is like follows:
public async Task<Guid> InsertAsync(TEntity entity)
{
await _context.Set<TEntity>().AddAsync(entity);
...
mi105
Votes: 0
Answers: 1