Esempio n. 1
0
        /// <summary>
        /// This region consists of all the actions which Removes existing users for Admin
        /// </summary>
        #region Remove Users

        /// <summary>
        /// This Action calls for the button which can delete an Admin
        /// </summary>
        /// <returns>The form view which contains list of Admins after deleting a paricular Admin</returns>
        public ActionResult RemoveAdminUser(int id)
        {
            if (Session["userId"] == null)
            {
                return(Redirect("~"));
            }
            AdminRemove Admin = new AdminRemove();

            Admin.DeleteAdmin(id);
            return(RedirectToAction("Admins"));
        }
Esempio n. 2
0
        public void RemoveAdminTest()
        {
            // Arrange
            Users user = new Users();

            user.Email = "*****@*****.**";
            AdminRemove removeAccount = new AdminRemove();
            Accounts    account       = new Accounts();
            var         sessionInfo   = account.SessionUserInfo(user);

            // Act
            bool result = removeAccount.DeleteAdmin(sessionInfo.Id);

            // Assert
            Assert.IsTrue(result);
        }