public void HasExpiredReturnsTrueForTimeEqualsNow()
        {
            // Arrange
            var subject = new ExpirationChecker();

            // Act
            var result = subject.HasExpired(DateTime.Now);

            // Assert
            Assert.That(result, Is.True);
        }
        public void HasExpiredReturnsTrueForPastDates()
        {
            // Arrange
            var subject = new ExpirationChecker();

            // Act
            var result = subject.HasExpired(new DateTime(1999,12,31));

            // Assert
            Assert.That(result, Is.True);
        }
        public void HasExpiredReturnsNotNull()
        {
            // Arrange
            var subject = new ExpirationChecker();

            // Act
            var result = subject.HasExpired(DateTime.Now);

            // Assert
            Assert.That(result, Is.Not.Null);
        }
        public void HasExpiredReturnsFalseForFutureDates()
        {
            // Arrange
            var subject = new ExpirationChecker();

            // Act
            var result = subject.HasExpired(new DateTime(2099, 12, 31));

            // Assert
            Assert.That(result, Is.False);
        }
        public async Task OnGetAsync()
        {
            var tasks = from x in _context.Tasks
                        select x;

            if (!string.IsNullOrEmpty(SearchString))
            {
                tasks = tasks.Where(t => t.Title.Contains(SearchString) ||
                                    t.Description.Contains(SearchString));
            }

            Tasks = await tasks.ToListAsync();

            ExpirationChecker expirationChecker = new ExpirationChecker((List <TodoItem>)Tasks);

            expirationChecker.Expire();

            _ = await _context.SaveChangesAsync();

            _progress.Count();
        }
 private bool ConversationIsTimeout(KeyValuePair <Guid, ConversationPoolItem> pair)
 {
     return(ExpirationChecker.IsConversationExpired(pair.Value.Conversation));
 }