private static DateTime GetRecordedDate(IConnectionHistory history)
 {
     var historyAccesor = new PrivateObject(history);
     var recordedItems = historyAccesor.Invoke("GetGroupedByDate") as SerializableDictionary<string, SortableList<IHistoryItem>>;
     var foundItem = recordedItems.SelectMany(group => group.Value).First();
     return foundItem.Date.ToUniversalTime();
 }
Пример #2
0
        private IConnectionHistory RecordHistoryItemToFilePersistence()
        {
            IFavorite          favorite = this.AddFavorite();
            IConnectionHistory history  = this.Persistence.ConnectionHistory;

            history.RecordHistoryItem(favorite);
            return(history);
        }
Пример #3
0
        private static DateTime GetRecordedDate(IConnectionHistory history)
        {
            var historyAccesor = new PrivateObject(history);
            var recordedItems  = historyAccesor.Invoke("GetGroupedByDate") as SerializableDictionary <string, SortableList <IHistoryItem> >;
            var foundItem      = recordedItems.SelectMany(group => group.Value).First();

            return(foundItem.Date.ToUniversalTime());
        }
Пример #4
0
        public void HistoryDateTimeIsInUtcTest()
        {
            InjectionDateTime.SetTestDateTime();
            IConnectionHistory history      = RecordHistoryItemToFilePersistence();
            DateTime           recordedDate = GetRecordedDate(history);

            Assert.AreEqual(recordedDate, Moment.Now, "Correct date wasn't delivered to the history file");
        }
Пример #5
0
        public void ClearHistoryTest()
        {
            this.Persistence.ConnectionHistory.HistoryClear += new Action(PrimaryHistory_HistoryClear);
            InjectionDateTime.SetTestDateTime();
            IConnectionHistory history = RecordHistoryItemToFilePersistence();

            history.Clear();
            int historyItems = history.GetDateItems(HistoryIntervals.TODAY).Count;

            Assert.AreEqual(0, historyItems, "File history wasnt clear properly");
            Assert.AreEqual(1, historyClearReported, "History clear wasnt reported properly");
        }