mirror of
https://github.com/alexhopeoconnor/binarylane-dotnet.git
synced 2026-10-20 23:01:29 +10:00
Initial BinaryLane v2 API client
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BinaryLane.Api.Tests;
|
||||
|
||||
internal sealed class HttpClientTestHandler : HttpMessageHandler
|
||||
{
|
||||
private readonly Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> _send;
|
||||
|
||||
public HttpClientTestHandler(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> send) =>
|
||||
_send = send ?? throw new ArgumentNullException(nameof(send));
|
||||
|
||||
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) =>
|
||||
_send(request, cancellationToken);
|
||||
}
|
||||
Reference in New Issue
Block a user