public async Task<StripeResponse<Pagination<Invoice>>> GetInvoices(InvoiceListFilter filter, CancellationToken cancellationToken = default(CancellationToken)) { var request = new StripeRequest<InvoiceListFilter, Pagination<Invoice>> { UrlPath = Paths.Invoices, Model = filter }; return await _client.Get(request, cancellationToken); }
public void InvoiceListFilter_DoesNotHaveRequiredFields() { // Arrange _filter = new InvoiceListFilter(); // Act var keyValuePairs = StripeClient.GetModelKeyValuePairs(_filter).ToList(); // Assert keyValuePairs.Should().HaveCount(0); }
public async Task GetInvoicesTest() { // Arrange var filter = new InvoiceListFilter(); _stripe.Get( Arg.Is<StripeRequest<InvoiceListFilter, Pagination<Invoice>>>( a => a.UrlPath == "invoices" && a.Model == filter), _cancellationToken) .Returns(Task.FromResult(new StripeResponse<Pagination<Invoice>>())); // Act var response = await _client.GetInvoices(filter, _cancellationToken); // Assert response.Should().NotBeNull(); }
public void Init() { _filter = GenFu.GenFu.New<InvoiceListFilter>(); }