Ejemplo n.º 1
0
        public void CanUpdateLastValidatedTime()
        {
            DateTime now = DateTime.Now;

            AuthenticationSessionRepository authenticationSessionRepository = new AuthenticationSessionRepository();
            var session = GetAuthenticationSession(authenticationSessionRepository, now);

            session.LastValidation = new DateTime(2013, 12, 12);
            session.Token          = "updatedToken" + now;

            authenticationSessionRepository.Add(session);

            AuthenticationSession result;
            bool success = authenticationSessionRepository.TryGetByToken("testToken" + now, out result);

            Assert.IsFalse(success);

            success = authenticationSessionRepository.TryGetByToken("updatedToken" + now, out result);
            Assert.IsTrue(success);
        }
Ejemplo n.º 2
0
        public void CanSaveAuthenticationSession()
        {
            DateTime now = DateTime.Now;

            AuthenticationSessionRepository authenticationSessionRepository = new AuthenticationSessionRepository();

            GetAuthenticationSession(authenticationSessionRepository, now);

            AuthenticationSession result;
            bool success = authenticationSessionRepository.TryGetByToken("testToken" + now.Ticks, out result);

            Assert.IsTrue(success);
        }