https://github.com/fgheysels/httptestutils
This project contains some helpfull classes that can be used when unit-tests have a dependency on HttpClient.
https://github.com/fgheysels/httptestutils
testing testing-tools
Last synced: 10 months ago
JSON representation
This project contains some helpfull classes that can be used when unit-tests have a dependency on HttpClient.
- Host: GitHub
- URL: https://github.com/fgheysels/httptestutils
- Owner: fgheysels
- Created: 2020-04-30T13:31:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T22:29:57.000Z (over 1 year ago)
- Last Synced: 2025-07-27T00:36:43.705Z (11 months ago)
- Topics: testing, testing-tools
- Language: C#
- Homepage:
- Size: 30.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# HttpTestUtils
[](https://frederikgheysels.visualstudio.com/GitHub%20Pipelines/_build/latest?definitionId=4&branchName=master)
[](https://www.nuget.org/packages/HttpTestUtils/)
# Introduction
`HttpTestUtils` contains some classes which make it easier to mock out dependencies on `HttpClient` during unit-tests.
## HttpClientMock
When code has a dependency on `HttpClient` it might be hard to test that code since in a unit-test you clearly do not want to send real HTTP messages. The `HttpClientMock` allows you to predefine the behaviour that must be executed by the `HttpClient` class.
Have a look at the `HttpClientMockTests` in the HttpTestUtils.Tests project to find out how to make use of it.