public void DeletePasswordReset_Pass() { //Arrange var newUser = tu.CreateUserObject(); tu.CreateUserInDb(newUser); var expected = pm.CreatePasswordReset(newUser.Id); //Act var response = pm.DeletePasswordReset(expected.ResetToken); var result = pm.ExistingResetToken(expected.ResetToken); //Assert Assert.IsNotNull(response); Assert.IsFalse(result); }
public void DeletePasswordReset_Pass() { //Arrange var newUser = tu.CreateUserObject(); tu.CreateUserInDb(newUser); using (_db = tu.CreateDataBaseContext()) { PasswordManager pm = new PasswordManager(_db); var expected = pm.CreatePasswordReset(newUser.Id); //Act var response = pm.DeletePasswordReset(expected.ResetToken); var result = pm.ExistingResetToken(expected.ResetToken); //Assert Assert.IsNotNull(response); Assert.IsFalse(result); } }
public void DeletePasswordReset_Fail_NonexistingToken() { //Arrange var newUser = tu.CreateUserObject(); tu.CreateUserInDb(newUser); string resetToken = "fakeResetToken"; //Act using (_db = tu.CreateDataBaseContext()) { PasswordManager pm = new PasswordManager(_db); var response = pm.DeletePasswordReset(resetToken); var result = pm.ExistingResetToken(resetToken); //Assert Assert.IsNotNull(response); Assert.IsFalse(result); } }