public async Task PostReset_WhenPasswordNotConfirmed_ExpectSuccess() { Logout(); var user = dataSamples.Users.FirstOrDefault(u => !u.Item1.IsPasswordSet); user.Item2.Password = string.Empty; user.Item2.LoginMethod = LoginMethod.EMAIL; var emailLoginResponse = await _http.PostAsync("api/auth/login", user.Item2.GetStringContent()); Assert.Equal(200, (int)emailLoginResponse.StatusCode); var loginCode = await _http.GetObject <Guid>($"api/testdata/verification-codes/{user.Item1.UserName}"); var loginResponse = await _http.GetAsync($"api/auth/code/{loginCode}"); Assert.Equal(200, (int)loginResponse.StatusCode); var reset = new PasswordReset { NewPassword = GoodLongPassword }; var resetResponse = await _http.PostAsync("api/auth/reset-password", reset.GetStringContent()); resetResponse.StatusCode.AssertStatusCode(200); Logout(); Login(); }
public async Task PostReset_WhenPasswordConfirmed_ExpectSuccess() { Login(); var reset = new PasswordReset { CurrentPassword = GoodLongPassword, NewPassword = GoodLongPassword }; var resetResponse = await _http.PostAsync("api/auth/reset-password", reset.GetStringContent()); resetResponse.StatusCode.AssertStatusCode(200); }