public async Task GetPdf_response_have_value() { var query = new QueryFilterBuilder <OutboxInvoiceGetModel>() .PageIndex(1) .PageSize(3) .QueryFor(q => q.Currency, Operator.Equal, "TRY") .Build(); var pageList = await inboxInvoiceClient.Get(query); var model = pageList.Items.FirstOrDefault(); var streamData = await inboxInvoiceClient.GetPdf(model.Id, false); using (var reader = new StreamReader(streamData, Encoding.UTF8)) { string value = reader.ReadToEnd(); Assert.Contains("PDF", value); } }
[HttpGet("pdf/{id}")] //48653485-b3ac-4daa-b9b4-aa8418a3a86b public async Task <IActionResult> GetPdf(Guid id) { var data = await inboxInvoiceClient.GetPdf(id, false); return(File(data, "application/pdf", $"{id}.zip")); }