public void BuildAuthenticateUser_AppAuthenticated_IAuthenticateUserWithInfo() { // Arrange var httpContextAccessor = this.GetHttpContextAccessor(HttpContextAccessorEnum.App); var identityService = new IdentityService <string>(options, httpContextAccessor, this.authenticateUser); // Act identityService.BuildAuthenticateUser(); // Assert Assert.True(this.authenticateUser.IsAuthenticated); Assert.True(this.authenticateUser.IsApplication); Assert.Null(this.authenticateUser.Name); Assert.Null(this.authenticateUser.Email); Assert.Null(this.authenticateUser.IdUser); }
public void BuildAuthenticateUser_UserAuthenticated_IAuthenticateUserWithInfo() { // Arrange var httpContextAccessor = this.GetHttpContextAccessor(HttpContextAccessorEnum.User); var identityService = new IdentityService <string>(options, httpContextAccessor, this.authenticateUser); // Act identityService.BuildAuthenticateUser(); // Assert Assert.True(this.authenticateUser.IsAuthenticated); Assert.False(this.authenticateUser.IsApplication); Assert.Equal("TestUser", this.authenticateUser.Name); Assert.Equal("*****@*****.**", this.authenticateUser.Email); Assert.Equal("1", this.authenticateUser.IdUser); }