Пример #1
0
        public void CheckExisting_GivenValidUser_RegistrationStatusNewUser()
        {
            var user = Substitute.For <IUser>();

            user.EmailAddress = "*****@*****.**";
            user.Password     = "******";

            var result = _registrationManager.CheckUserExists(user);

            Assert.AreEqual(RegistrationStatus.NewUser, result);
        }
Пример #2
0
        /// <summary>
        /// Login the specified user.
        /// </summary>
        /// <returns>The login.</returns>
        /// <param name="user">User.</param>
        public LoginStatus Login(IUser user)
        {
            var result = _registrationManager.CheckUserExists(user);

            if (result == RegistrationStatus.UserExists)
            {
                return(_loginManager.Login(user));
            }
            return(LoginStatus.UserDoesNotExist);
        }