public async Task GetCardsTest()
        {
            // Arrange
            var filter = new CustomerCardListFilter
            {
                CustomerId = "customer-id"
            };
            _stripe.Get(
                Arg.Is<StripeRequest<CustomerCardListFilter, Pagination<Card>>>(
                    a => a.UrlPath == "customers/" + filter.CustomerId + "/sources" && a.Model == filter),
                _cancellationToken).Returns(Task.FromResult(new StripeResponse<Pagination<Card>>()));

            // Act
            var response = await _client.GetCards(filter, _cancellationToken);

            // Assert
            response.Should().NotBeNull();
        }
예제 #2
0
 public async Task<StripeResponse<Pagination<Card>>> GetCards(CustomerCardListFilter filter,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StripeRequest<CustomerCardListFilter, Pagination<Card>>
     {
         UrlPath = PathHelper.GetPath(Paths.Customers, filter.CustomerId, Paths.Sources),
         Model = filter
     };
     return await _client.Get(request, cancellationToken);
 }
 public void Init()
 {
     _filter = GenFu.GenFu.New<CustomerCardListFilter>();
 }