示例#1
0
        public DbRepoStatusCode ValidateAccount(int accountId, string isActive)
        {
            using (var context = new ApplicationDbContext())
            {
                var account = context.Users
                              .Include(u => u.AccountType)
                              .SingleOrDefault(u => u.Id == accountId);

                if (account == null)
                {
                    return(DbRepoStatusCode.NotFound);
                }

                if (account.AccountType == null)
                {
                    return(DbRepoStatusCode.BadRequest);
                }

                _accountService.ValidateAccount(account, isActive);

                context.SaveChanges();

                return(DbRepoStatusCode.Success);
            }
        }
示例#2
0
        public void AccountValidate(string request, bool isActive)
        {
            _accountManageService.ValidateAccount(_account, request);

            Assert.AreEqual(_account.IsActive, isActive);
        }