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); }
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); }