Mock implementation of HttpWrapper.
More...
|
void | ResetMockResponses () |
| Clears all mock responses. Used between tests to ensure mocks don't interfere with other tests. More...
|
|
void | AddMockResponse (string endpoint, HttpResponseMessage response, HttpMethods httpMethod) |
| Adds a given response as a mock for the endpoint. More...
|
|
void | AddMockResponse (string endpoint, DevicePortalPlatforms platform, string friendlyOperatingSystemVersion, HttpMethods httpMethod) |
| Adds a response for this endpoint, loading from the file matching the deviceType and OsVersion More...
|
|
void | AddMockResponse (string endpoint, HttpMethods httpMethod) |
| Adds a default response for this endpoint, device agnostic. More...
|
|
async Task< HttpResponseMessage > | GetAsync (Uri uri) |
| Abstract method Mock Implementation More...
|
|
async Task< HttpResponseMessage > | PostAsync (Uri uri, HttpContent content) |
| Abstract method Mock Implementation More...
|
|
async Task< HttpResponseMessage > | PutAsync (Uri uri, HttpContent content) |
| Abstract method Mock Implementation More...
|
|
async Task< HttpResponseMessage > | DeleteAsync (Uri uri) |
| Abstract method Mock Implementation More...
|
|
async Task< HttpResponseMessage > | WebSocketAsync (Uri uri) |
| Abstract method Mock Implementation More...
|
|
Mock implementation of HttpWrapper.
void Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.AddMockResponse |
( |
string |
endpoint, |
|
|
HttpResponseMessage |
response, |
|
|
HttpMethods |
httpMethod |
|
) |
| |
|
inline |
Adds a given response as a mock for the endpoint.
- Parameters
-
endpoint | The endpoint to be mocked. |
response | The response to return. |
httpMethod | HTTP method we are mocking. |
void Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.AddMockResponse |
( |
string |
endpoint, |
|
|
DevicePortalPlatforms |
platform, |
|
|
string |
friendlyOperatingSystemVersion, |
|
|
HttpMethods |
httpMethod |
|
) |
| |
|
inline |
Adds a response for this endpoint, loading from the file matching the deviceType and OsVersion
- Parameters
-
endpoint | Endpoint we are mocking. |
platform | Device platform we are testing. |
friendlyOperatingSystemVersion | The friendly name of the OS Version we are testing, used to find the mock file. |
httpMethod | HTTP method we are mocking. |
void Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.AddMockResponse |
( |
string |
endpoint, |
|
|
HttpMethods |
httpMethod |
|
) |
| |
|
inline |
Adds a default response for this endpoint, device agnostic.
- Parameters
-
endpoint | Endpoint we are mocking. |
httpMethod | HTTP method we are mocking. |
async Task<HttpResponseMessage> Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.DeleteAsync |
( |
Uri |
uri | ) |
|
|
inline |
Abstract method Mock Implementation
- Parameters
-
- Returns
- Async task returning the response.
async Task<HttpResponseMessage> Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.GetAsync |
( |
Uri |
uri | ) |
|
|
inline |
Abstract method Mock Implementation
- Parameters
-
- Returns
- Async task returning the response.
async Task<HttpResponseMessage> Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.PostAsync |
( |
Uri |
uri, |
|
|
HttpContent |
content |
|
) |
| |
|
inline |
Abstract method Mock Implementation
- Parameters
-
uri | The target URI. |
content | The HTTP body of the request. |
- Returns
- Async task returning the response.
async Task<HttpResponseMessage> Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.PutAsync |
( |
Uri |
uri, |
|
|
HttpContent |
content |
|
) |
| |
|
inline |
Abstract method Mock Implementation
- Parameters
-
uri | The target URI. |
content | The HTTP body of the request. |
- Returns
- Async task returning the response.
void Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.ResetMockResponses |
( |
| ) |
|
|
inline |
Clears all mock responses. Used between tests to ensure mocks don't interfere with other tests.
async Task<HttpResponseMessage> Microsoft.Tools.WindowsDevicePortal.Tests.MockHttpResponder.WebSocketAsync |
( |
Uri |
uri | ) |
|
|
inline |
Abstract method Mock Implementation
- Parameters
-
- Returns
- Async task returning the response.
The documentation for this class was generated from the following file:
- WindowsDevicePortalWrapper/UnitTestProject/MockHttpResponder.cs