i want to unit test a repository that uses the the HttpClientFactory.i asked the question how do i unit test a repo that calls IHttpClientFactory with Nunit. Helpful enough someone suggested i check a similar question which was asked at How to mock the new HttpClientFactory in .NET Core 2.1 using Moq. Following the suggested solution,i stumbled another problem,a method in the most voted answer to the question is not working. the line of code in solution is
_handlerFunc = (request, cancellationToken) => Task.FromResult(request.CreateResponse(HttpStatusCode.OK));
The method request.CreateResponse
seems that it does not exist for the request object.Am using asp.netcore 3.1