Пример #1
0
 public async Task<StripeResponse<Order>> UpdateOrder(OrderUpdateArguments arguments,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StripeRequest<OrderUpdateArguments, Order>
     {
         UrlPath = PathHelper.GetPath(Paths.Orders, arguments.OrderId),
         Model = arguments
     };
     return await _client.Post(request, cancellationToken);
 }
        public async Task UpdateOrderTest()
        {
            // Arrange
            var args = new OrderUpdateArguments
            {
                OrderId = "order-id"
            };
            _stripe.Post(
                Arg.Is<StripeRequest<OrderUpdateArguments, Order>>(
                    a => a.UrlPath == "orders/" + args.OrderId && a.Model == args), _cancellationToken)
                .Returns(Task.FromResult(new StripeResponse<Order>()));

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

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