public void Activate()
        {
            User user      = authentication.CreateUser(UserEmail, UserLogin, UserPassword);
            bool success   = authentication.Activate(user.UserHash, ref message);
            bool unsuccess = authentication.Activate(user.UserHash, ref message);

            user.Deleted  = true;
            user.Activate = 0;
            context.User.Update(user);
            context.SaveChanges();
            bool deleted = authentication.Activate(user.UserHash, ref message);

            Assert.AreEqual(success, true);
            Assert.AreEqual(unsuccess, false);
            Assert.AreEqual(deleted, false);
        }
예제 #2
0
        public ActionResult <dynamic> Activate([FromQuery] string hash)
        {
            string message = null;

            if (authentication.Activate(hash, ref message))
            {
                return(new { success = true, message = "User account is successfully active." });
            }
            return(Return500Error(message));
        }