Questions tagged [mockhttpmessagehandler]
5 questions
2
votes
1 answer
Mock Refit SDK injection with a Mock HttpClient for Integration Testing
For a .Net Core 3.1 WebApi project, I want to test the full pipeline of my application while mocking out the external calls (not a unit test, full test). This app uses Refit SDK to inject SDKs for external calls. I want to be able to override the…

Hope
- 125
- 9
2
votes
1 answer
What calls Dispose() method in c# MSTest unit test?
I currently reviewing a test class that uses MSTest and implements IDisposable. The test itself is testing a custom client and has an instance of
MockHttpMessageHandler by RichardSzalay.MockHttp
which implements the IDisposable interface.
The…

eVolve
- 1,340
- 1
- 11
- 30
0
votes
0 answers
Node-mocks-https throwing build issue after node 18 upgrade
I have a requirement to migrate to node 18 from 16 for node application.
am getting below error while npm run test
/apps/node_modules/node-mocks-http/lib/mockRequest.js: Unexpected token * (550:54)
mockRequest[Symbol.asyncIterator] = async function*…

Lokesh
- 59
- 1
- 11
0
votes
1 answer
RestSharp v108 Missing ConfigureMessageHandler for Mocking Responses in Unit Tests
I am reading the documentation for converting to v107+. I'm currently using v108. In the documentation, for mocking, it says to do this:
var client = new RestClient(...) { ConfigureMessageHandler = _ => mockHttp };
But apparently v108 no longer…

stricq
- 798
- 6
- 18
0
votes
1 answer
How to check whether the access token is valid or not?
In the below code, am looking to renew access token if it is expired. But nothing works. I tried to debug with breakpoint on line return response but that breakpoint will not trigger.
protected override async Task…

rajesh
- 1,475
- 10
- 23