Пример #1
0
 public async Task<StripeResponse<Pagination<Invoice>>> GetUpcomingInvoices(UpcomingInvoiceArguments filter,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StripeRequest<UpcomingInvoiceArguments, Pagination<Invoice>>
     {
         UrlPath = PathHelper.GetPath(Paths.Invoices, Paths.Upcoming),
         Model = filter
     };
     return await _client.Get(request, cancellationToken);
 }
        public void UpcomingInvoiceListFilter_DoesNotHaveRequiredFields()
        {
            // Arrange 
            _args = new UpcomingInvoiceArguments();

            // Act
            var keyValuePairs = StripeClient.GetModelKeyValuePairs(_args).ToList();

            // Assert
            keyValuePairs.Should().HaveCount(0);
        }
        public async Task GetUpcomingInvoicesTest()
        {
            // Arrange
            var filter = new UpcomingInvoiceArguments
            {
                Customer = "customer-id"
            };
            _stripe.Get(
                Arg.Is<StripeRequest<UpcomingInvoiceArguments, Pagination<Invoice>>>(
                    a => a.UrlPath == "invoices/upcoming" && a.Model == filter), _cancellationToken)
                .Returns(Task.FromResult(new StripeResponse<Pagination<Invoice>>()));

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

            // Assert
            response.Should().NotBeNull();
        }
 public void Init()
 {
     _args = GenFu.GenFu.New<UpcomingInvoiceArguments>();
 }