protected void un_administrateur_authentifé() { _userAdmin = TestData.MiamUserAdmin; TestHelperApi.Users.Add(_userAdmin); Host.Instance.NavigateToInitialPage<HomePage>() .NavigationMenu .ClickLogin() .LoginAs(_userAdmin.Email, _userAdmin.Password); }
private void AuthentificateUser(MiamUser miamUser) { var identity = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, miamUser.Email), new Claim(ClaimTypes.NameIdentifier, miamUser.Id.ToString()), }, DefaultAuthenticationTypes.ApplicationCookie); foreach (var role in miamUser.Roles) { identity.AddClaim(new Claim(ClaimTypes.Role, role.RoleName)); } _httpContext.AuthenticationSignIn(identity); }
public void Add(MiamUser miamUserAdmin) { var dbContext = _dbContextFactory.Create(); dbContext.MiamUsers.Add(miamUserAdmin); dbContext.SaveChanges(); }
private void un_administrateur_existant_non_authentifé() { _userAdmin = TestData.MiamUserAdmin; TestHelperApi.Users.Add(_userAdmin); }