public void Update_UserExistsNewTimeStamp_ModifiedTimeStamp() { var time = DateTime.Now; var newUser = new LoginData() { UserId = TestUserId, TimeStamp = time, PasswordUsed = false }; Repository.Update(newUser); var user = Repository.GetById(User.UserId); Assert.AreEqual(time, user.TimeStamp); }
public void VerifyData(string userId, DateTime date) { var user = Repository.GetById(userId); if (user == null) { user = new LoginData() { UserId = userId, TimeStamp = date }; Repository.Insert(user); } if (date <= user.TimeStamp.AddSeconds(30) && !user.PasswordUsed) { return; } user.TimeStamp = date; user.PasswordUsed = false; Repository.Update(user); }
public void GetUser_UserExists_User() { var checkUser = Repository.GetById(TestUserId); Assert.AreEqual(User, checkUser); }