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