Ejemplo n.º 1
0
        public async Task <StripeResponse <Invoice> > UpdateInvoice(InvoiceUpdateArguments arguments,
                                                                    CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new StripeRequest <InvoiceUpdateArguments, Invoice>
            {
                UrlPath = PathHelper.GetPath(Paths.Invoices, arguments.InvoiceId),
                Model   = arguments
            };

            return(await _client.Post(request, cancellationToken));
        }
Ejemplo n.º 2
0
        public async Task UpdateInvoiceTest()
        {
            // Arrange
            var args = new InvoiceUpdateArguments
            {
                InvoiceId = "invoice-id"
            };

            _stripe.Post(
                Arg.Is <StripeRequest <InvoiceUpdateArguments, Invoice> >(
                    a => a.UrlPath == "invoices/" + args.InvoiceId && a.Model == args), _cancellationToken)
            .Returns(Task.FromResult(new StripeResponse <Invoice>()));

            // Act
            var response = await _client.UpdateInvoice(args, _cancellationToken);

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