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

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

            var result = _registrationManager.Register(user);

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

            if (registrationResult == RegistrationStatus.Success)
            {
                _configurationManager.SaveUsersAsync(_registrationManager.Users);
            }
            return(registrationResult);
        }
 public ActionResult Register([FromBody] RegisterModel model)
 {
     _registrationManager.Register(model);
     return(Ok());
 }