Exemplo n.º 1
0
        public async Task CreateAccount(int identityUser, int index, bool result)
        {
            var testData           = PandaAccountCreateContractTestData.pandaAccountCreateContracts[index];
            var runStatementResult = await accountFacade.CreateAccount(identityUser, testData);

            Assert.Equal(runStatementResult.IsError(), result);
        }
Exemplo n.º 2
0
        public IActionResult StoreAccount()
        {
            var account = CurrentAccountProvider.GetCurrentAccount(HttpContext.User);

            if (account != null)
            {
                return(RedirectWithError(ExpenseManagerResource.YouHaveAccount));
            }

            var user = CurrentAccountProvider.GetCurrentUser(HttpContext.User);

            _accountFacade.CreateAccount(user.Id);

            return(RedirectToAction("Index", "Expense", new { sucessMessage = ExpenseManagerResource.AccountCreated }));
        }
Exemplo n.º 3
0
        public void CreateAccount_NewAccount_CreatesAccount()
        {
            const string accountName = "ExpenseManagerAccount01";

            // Arrange
            var account = new Account
            {
                Badges = new List <AccountBadge>(),
                Costs  = new List <CostInfo>(),
                Name   = accountName
            };

            // Act
            _accountFacade.CreateAccount(account);

            // Assert
            var createdAccount = GetAccountByName(accountName);

            Assert.That(createdAccount != null, "Account was not created.");
        }