public void IsExpired29Minutes59Second() { // Arrange var token = new Token { CreateDate = DateTime.Now.AddSeconds(-1799) }; var validator = new DatabaseTokenValidator(null); // Act var actual = validator.IsExpired(token); // Assert Assert.IsFalse(actual); }
internal bool IsExpired(Token token) { var span = DateTime.Now - token.CreateDate; return span.TotalSeconds > DefaultSecondsUntilTokenExpires; }