コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void last_20_filter_has_correct_label()
 {
     Check.That(TravelHistoryFilter.Last(20).Label).IsEqualTo("Last 20 entries");
 }