mockhttp
RestClient.Net
Our great sponsors
mockhttp | RestClient.Net | |
---|---|---|
5 | 11 | |
1,544 | 361 | |
- | - | |
6.2 | 3.8 | |
2 months ago | about 1 month ago | |
C# | C# | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
mockhttp
-
Mock heavy tests
I'd say that without wanting to refactor the code a little bit (maybe moving those HttpClients into a service so that they are easily mocked) your best bet would be to use something like WireMock or MockHttp.
-
I created a simpler RestSharp alternative, SimpleHttpClient
What is the need to create a wrapper around the HttpClient? If it's for mocking, you can use this MockedHttpClientHandler for you tests
-
How to write tests for HttpClient using Moq
Voilà! That's how to write tests with HttpClient and Moq. With some extension methods, we could have a small DSL to write more readable tests. For a more fully-featured alternative to write tests for HttpClient, check mockhttp, "a testing layer for Microsoft's HttpClient library."
-
Help: how to memory-host & test a unit-test controller/service?
So if you need to mock http client you may want to look into a library like https://github.com/richardszalay/mockhttp
- RestClient.Net 5.0.x Beta Released
RestClient.Net
- What's the deal with HttpClient?
-
RestClient.Net 5 – ChristianFindlay.com
https://github.com/MelbourneDeveloper/RestClient.Net/blob/5263ff4cd90bdd7c4a97c600baaf2ecc7e94599c/src/RestClient.Net.UnitTests/MainUnitTests.cs#L1010
- Mocking http requests made within api call for integration testing
- RestClient.Net 5.0.x Released
-
RestClient.Net 5.0.x Beta Released
RestClient .Net is completely immutable and therefore much more thread-safe. It also works well with standard Microsoft dependency injection, and it's easy to mock. Have a look at the abstraction. If you use this, it's a one-step process for mocking HTTP calls.
https://github.com/MelbourneDeveloper/RestClient.Net/blob/e7edf5c1b40305732af3b0bd10c548996889ba97/src/RestClient.Net.Abstractions/IClient.cs#L9
- RestClient.Net - 5.0.x Beta Released
What are some alternatives?
WireMock.Net - WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.
RestSharp - Simple REST and HTTP API Client for .NET
Mmock - Mmock is an HTTP mocking application for testing and fast prototyping
PdfSharpCore - Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
minimock - Powerful mock generation tool for Go programming language
dotnet-grpc - Code samples for the Introduction to gRPC series in .NET!
httpclient-interception - A .NET library for intercepting server-side HTTP requests
fmdata - A simple and flexible FileMaker Data API Client for .NET. Use FMData to integrate your FileMaker data into .NET websites and applications.
FakeItEasy - The easy mocking library for .NET
DevToAPI - Forem/DEV API Client Library for .NET
NSubstitute - A friendly substitute for .NET mocking libraries.
ReactiveUI - An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.