Exemple #1
0
    public void CreateAppraiserUser(SignUpAppraiserViewModel signUpAppraiser)
    {
      User user = new User();
      user.DateCreated = DateTime.Now;
      user.Email = signUpAppraiser.Email;
      user.FirstName = signUpAppraiser.FirstName;
      user.LastName = signUpAppraiser.LastName;
      user.Roles = new Role[] { _referenceManagement.GetRoleWithoutCache(RoleType.Appraiser) };

      _appraiserManager.CheckAndCreateAppraiserUser(user, signUpAppraiser.Password);
    }
		public ActionResult Index(SignUpAppraiserViewModel signUpAppraiser)
		{
			if (!ModelState.IsValid)
			{
				return View();
			}

      _appraiserSignUpService.CreateAppraiserUser(signUpAppraiser);
			CommitProviderInstance.Commit();
			_authenticationProvider.SetAuthCookie(signUpAppraiser.Email, false, Response);

			return RedirectToAction(NameHelper.AppraiserWizard.Index, NameHelper.AppraiserWizard.Controller, new { area = "SignUp" });
		}
		public void SignUpActionShouldRedirectToHomePage()
		{
			var user = new SignUpAppraiserViewModel() { Password = "******", RepeatPassword = "******", FirstName = "FName", LastName = "LName", Email = "*****@*****.**", IsAcknowledged = true };
      var actionResult = Target.Index(user);
			actionResult.Should().NotBeNull().And.BeOfType<RedirectToRouteResult>();
		}