コード例 #1
0
        public void Data_age_filter_removes_data_older_than_the_limit_and_keeps_data_more_recent_than_the_limit()
        {
            var now         = HistoryEntry.MakeVSEntry(sol, DateTime.UtcNow, 0, "", "");
            var fourDaysAgo = HistoryEntry.MakeVSEntry(sol, DateTime.UtcNow.Subtract(TimeSpan.FromDays(4)), 0, "", "");
            var input       = new HistoryList(new List <HistoryEntry> {
                fourDaysAgo, now
            });

            Check.That(TravelHistoryFilter.FromDays(2).Filter(input)).ContainsExactly(now);
        }
コード例 #2
0
        public void Data_age_filter_removes_data_older_than_the_limit_and_keeps_data_more_recent_than_the_limit()
        {
            var fourDaysAgo = HistoryEntry.FromJournalEntry(new JournalFSDJump(DateTime.UtcNow.Subtract(TimeSpan.FromDays(4)), sol, 0, false, 0), null, out bool notused1);
            var now         = HistoryEntry.FromJournalEntry(new JournalFSDJump(DateTime.UtcNow.Subtract(TimeSpan.FromDays(0)), sol, 0, false, 0), null, out bool notused2);
            var input       = new HistoryList(new List <HistoryEntry> {
                fourDaysAgo, now
            });

            Check.That(TravelHistoryFilter.FromDays(2).Filter(input)).ContainsExactly(now);
        }
コード例 #3
0
        public void Data_age_filter_removes_data_older_than_the_limit_and_keeps_data_more_recent_than_the_limit()
        {
            var now = new VisitedSystemsClass {
                Time = DateTime.Now
            };
            var fourDaysAgo = new VisitedSystemsClass {
                Time = DateTime.Now.Subtract(TimeSpan.FromDays(4))
            };
            var input = new List <VisitedSystemsClass> {
                fourDaysAgo, now
            };

            Check.That(TravelHistoryFilter.FromDays(2).Filter(input)).ContainsExactly(now);
        }
コード例 #4
0
        public void Data_age_filter_removes_data_older_than_the_limit_and_keeps_data_more_recent_than_the_limit()
        {
            var now = new HistoryEntry {
                EventTimeUTC = DateTime.UtcNow
            };
            var fourDaysAgo = new HistoryEntry {
                EventTimeUTC = DateTime.UtcNow.Subtract(TimeSpan.FromDays(4))
            };
            var input = new HistoryList {
                fourDaysAgo, now
            };

            Check.That(TravelHistoryFilter.FromDays(2).Filter(input)).ContainsExactly(now);
        }
コード例 #5
0
 public void Last_days_filter_has_correct_label()
 {
     Check.That(TravelHistoryFilter.FromDays(3).Label).IsEqualTo("3 days");
 }