0

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 works this way and the documentation has not been updated. Does v108 support setting the MessageHandler? My company uses SonarQube for unit test code coverage and we are missing several hundred lines of coverage without this capability.

stricq
  • 798
  • 6
  • 18

1 Answers1

0

The RestClient class never had a property called ConfigureHttpMessageHandler.

The top of the documentation page has the correct code:

enter image description here

Indeed, the code in the "Mocking" section is wrong; it's just a typo.

Alexey Zimarev
  • 17,944
  • 2
  • 55
  • 83
  • 1
    I was able to find the correct way to do by using the config object. But the tutorial page was wrong. – stricq Nov 29 '22 at 14:59