예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public void GetUser_UserExists_User()
        {
            var checkUser = Repository.GetById(TestUserId);

            Assert.AreEqual(User, checkUser);
        }