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); }
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); }
public void Last_2_items_filter_returns_the_2_most_recent_items_sorted_by_most_recent_and_removes_the_older_items() { var twentyDaysAgo = HistoryEntry.MakeVSEntry(sol, DateTime.UtcNow.Subtract(TimeSpan.FromDays(20)), 0, "", ""); var tenDaysAgo = HistoryEntry.MakeVSEntry(sol, DateTime.UtcNow.Subtract(TimeSpan.FromDays(10)), 0, "", ""); var thirtyDaysAgo = HistoryEntry.MakeVSEntry(sol, DateTime.UtcNow.Subtract(TimeSpan.FromDays(30)), 0, "", ""); var input = new HistoryList(new List <HistoryEntry> { twentyDaysAgo, tenDaysAgo, thirtyDaysAgo }); Check.That(TravelHistoryFilter.Last(2).Filter(input)).ContainsExactly(tenDaysAgo, twentyDaysAgo); }
public void Last_2_items_filter_returns_the_2_most_recent_items_sorted_by_most_recent_and_removes_the_older_items() { var twentyDaysAgo = HistoryEntry.FromJournalEntry(new JournalFSDJump(DateTime.UtcNow.Subtract(TimeSpan.FromDays(20)), sol, 0, false, 0), null, out bool notused); var tenDaysAgo = HistoryEntry.FromJournalEntry(new JournalFSDJump(DateTime.UtcNow.Subtract(TimeSpan.FromDays(10)), sol, 0, false, 0), null, out bool notused2); var thirtyDaysAgo = HistoryEntry.FromJournalEntry(new JournalFSDJump(DateTime.UtcNow.Subtract(TimeSpan.FromDays(30)), sol, 0, false, 0), null, out bool notused3); var input = new HistoryList(new List <HistoryEntry> { twentyDaysAgo, tenDaysAgo, thirtyDaysAgo }); Check.That(TravelHistoryFilter.Last(2).Filter(input)).ContainsExactly(tenDaysAgo, twentyDaysAgo); }
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); }
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); }
public void Last_2_items_filter_returns_the_2_most_recent_items_sorted_by_most_recent_and_removes_the_older_items() { var twentyDaysAgo = new VisitedSystemsClass { Time = DateTime.Now.Subtract(TimeSpan.FromDays(20)) }; var tenDaysAgo = new VisitedSystemsClass { Time = DateTime.Now.Subtract(TimeSpan.FromDays(10)) }; var thirtyDaysAgo = new VisitedSystemsClass { Time = DateTime.Now.Subtract(TimeSpan.FromDays(30)) }; var input = new List <VisitedSystemsClass> { twentyDaysAgo, tenDaysAgo, thirtyDaysAgo }; Check.That(TravelHistoryFilter.Last(2).Filter(input)).ContainsExactly(tenDaysAgo, twentyDaysAgo); }
public void Last_week_filter_has_correct_label() { Check.That(TravelHistoryFilter.FromWeeks(1).Label).IsEqualTo("One Week"); }
public void Last_days_filter_has_correct_label() { Check.That(TravelHistoryFilter.FromDays(3).Label).IsEqualTo("3 days"); }
public void Last_6_hours_filter_has_correct_label() { Check.That(TravelHistoryFilter.FromHours(6).Label).IsEqualTo("6 hours"); }
public void last_20_filter_has_correct_label() { Check.That(TravelHistoryFilter.Last(20).Label).IsEqualTo("Last 20 entries"); }
public void Last_month_filter_has_correct_label() { Check.That(TravelHistoryFilter.LastMonth().Label).IsEqualTo("Month"); }
public void Last_3_weeks_filter_has_correct_label() { Check.That(TravelHistoryFilter.FromWeeks(3).Label).IsEqualTo("3 weeks"); }