Пример #1
0
 public async Task<StripeResponse<Plan>> CreatePlan(PlanCreateArguments arguments,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new StripeRequest<PlanCreateArguments, Plan>
     {
         UrlPath = Paths.Plans,
         Model = arguments
     };
     return await _client.Post(request, cancellationToken);
 }
Пример #2
0
        public async Task CreatePlanTest()
        {
            // Arrange
            var args = new PlanCreateArguments();
            _stripe.Post(
                Arg.Is<StripeRequest<PlanCreateArguments, Plan>>(a => a.UrlPath == "plans" && a.Model == args),
                _cancellationToken).Returns(Task.FromResult(new StripeResponse<Plan>()));

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

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