/// <inheritdoc /> public async Task <Stream> GetDocumentAsync( string transactionId, string fileId, CancellationToken cancellationToken = default) { return(await retryPolicy .ExecuteAsync( ct => client.GetDocumentAsync( transactionId, fileId, ct), cancellationToken)); }
public async Task when_GetDocument_is_called_then_we_should_have_called_the_file_get_once() { var mockHttp = new MockHttpMessageHandler(); mockHttp.Expect(HttpMethod.Get, "http://localhost/api/transaction/*/file/file Id") .Respond(HttpStatusCode.OK, new StringContent(string.Empty)); using (var httpClient = mockHttp.ToHttpClient()) { var signhostApiClient = new SignHostApiClient(settings, httpClient); var document = await signhostApiClient.GetDocumentAsync("transaction Id", "file Id"); } mockHttp.VerifyNoOutstandingExpectation(); }