Пример #1
0
        public void CreateAccount()
        {
            //Setup
            Account insertAccount = new Account()
            {
                UserName    = "******",
                FirstName   = "Lars",
                LastName    = "van den Brandt",
                Email       = "*****@*****.**",
                PhoneNumber = 0636484221,
                Password    = "******"
            };

            bool found = false;

            //Action
            accountCollection.CreateAccount(insertAccount);

            //Assert
            foreach (Account account in accountCollection.GetAccounts())
            {
                if (account.UserName.Equals("LarsvandenBrandt"))
                {
                    found = true;
                }
            }
            Assert.IsTrue(found);
        }
Пример #2
0
        public async Task <IActionResult> AddAccount(AddAccountViewModel model)
        {
            account = new Account();

            account.UserID      = model.UserID;
            account.UserName    = model.UserName;
            account.FirstName   = model.FirstName;
            account.LastName    = model.LastName;
            account.Email       = model.Email;
            account.PhoneNumber = model.PhoneNumber;
            account.Password    = model.Password;

            int rowcount = accountCollection.CreateAccount(account);

            if (rowcount == 1)
            {
                return(RedirectToAction("RegistrationSuccessPage"));
            }
            else
            {
                return(RedirectToAction("FailPage"));
            }
        }