예제 #1
0
 public async Task<StripeResponse<Invoice>> CreateInvoice(InvoiceCreateArguments arguments,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StripeRequest<InvoiceCreateArguments, Invoice>
     {
         UrlPath = Paths.Invoices,
         Model = arguments
     };
     return await _client.Post(request, cancellationToken);
 }
 public void Init()
 {
     _args = GenFu.GenFu.New<InvoiceCreateArguments>();
 }
        public async Task CreateInvoiceTest()
        {
            // Arrange
            var args = new InvoiceCreateArguments();
            _stripe.Post(
                Arg.Is<StripeRequest<InvoiceCreateArguments, Invoice>>(a => a.UrlPath == "invoices" && a.Model == args),
                _cancellationToken).Returns(Task.FromResult(new StripeResponse<Invoice>()));

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

            // Assert
            response.Should().NotBeNull();
        }