net_mock library
net_mock is a Dart package that streamlines the process of mocking HTTP requests in your tests.
Inspired by NetMock, it extends the http.MockClient
package by adding a layer of syntactic sugar. This makes it even more straightforward to define and
manage expected requests and responses, allowing you to focus on writing clear and concise tests.
Classes
- NetMock
-
A utility class for mocking HTTP requests and responses using
http.MockClient. - NetMockRequest
-
Represents an HTTP request in
net_mock - NetMockResponse
-
Represents an HTTP response in
net_mock
Enums
- Method
-
Represents HTTP methods or verbs in
net_mock.
Extensions
- NetMockResponseExtension on NetMockResponse
- RequestExtension on Request
Functions
-
readFromResources(
String fileName) → Future< String> - Helper function to read resource files in the test/resources folder.