Пример #1
0
 public async Task<StripeResponse<Transfer>> CreateTransfer(TransferCreateArguments arguments,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StripeRequest<TransferCreateArguments, Transfer>
     {
         UrlPath = Paths.Transfers,
         Model = arguments
     };
     return await _client.Post(request, cancellationToken);
 }
        public async Task CreateTransferTest()
        {
            // Arrange
            var args = new TransferCreateArguments();
            _stripe.Post(
                Arg.Is<StripeRequest<TransferCreateArguments, Transfer>>(
                    a => a.UrlPath == "transfers" && a.Model == args), _cancellationToken)
                .Returns(Task.FromResult(new StripeResponse<Transfer>()));

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

            // Assert
            response.Should().NotBeNull();
        }
 public void Init()
 {
     GenFu.GenFu.Configure<TransferCreateArguments>().Fill(x => x.Amount, () => 100);
     _args = GenFu.GenFu.New<TransferCreateArguments>();
 }