Beispiel #1
0
        public async Task <ActionResult> Create(AccountViewModel model)
        {
            var response = await _accountClient.CreateAccount(model);

            if (response.StatusIsSuccessful)
            {
                var accountId = response.Data;
                return(RedirectToAction("Details", new { id = accountId }));
            }

            AddResponseErrorsToModelState(response);
            model.AccountTypes = await GetAccountTypes();

            return(View(model));
        }
        public async Task CreateAccountTest()
        {
            // Arrange
            var args = new AccountCreateArguments();

            _stripe.Post(
                Arg.Is <StripeRequest <AccountCreateArguments, Account> >(a => a.UrlPath == "accounts" && a.Model == args),
                _cancellationToken).Returns(Task.FromResult(new StripeResponse <Account>()));

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

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