示例#1
0
        public async Task <StripeResponse <Pagination <Card> > > GetCards(AccountCardListFilter filter,
                                                                          CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new StripeRequest <AccountCardListFilter, Pagination <Card> >
            {
                UrlPath = PathHelper.GetPath(Paths.Accounts, filter.AccountId, Paths.ExternalAccounts),
                Model   = filter
            };

            return(await _client.Get(request, cancellationToken));
        }
        public async Task GetCardsTest()
        {
            // Arrange
            var filter = new AccountCardListFilter
            {
                AccountId = "account-id"
            };

            _stripe.Get(
                Arg.Is <StripeRequest <AccountCardListFilter, Pagination <Card> > >(
                    a => a.UrlPath == "accounts/" + filter.AccountId + "/external_accounts" && a.Model == filter),
                _cancellationToken).Returns(Task.FromResult(new StripeResponse <Pagination <Card> >()));

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

            // Assert
            response.Should().NotBeNull();
        }
示例#3
0
 public void Init()
 {
     _filter = GenFu.GenFu.New <AccountCardListFilter>();
 }