public void GetLatestLogEntries_ReturnsLogEntries()
        {
            // ARRANGE
            _writeService.WriteLog(Models.LogType.Information, nameof(GetLatestLogEntries_ReturnsLogEntries), null, "Test Log Entry 1", string.Empty);
            _writeService.WriteLog(Models.LogType.Information, nameof(GetLatestLogEntries_ReturnsLogEntries), null, "Test Log Entry 2", string.Empty);

            // ACT
            var logEntries = _readService.GetLatestLogEntries(100);

            // ASSERT
            Assert.IsTrue(_mockContext.LogEntries.Count() == 2);
        }
Exemple #2
0
        /// <summary>
        /// Get a list of the most recent Log Entries
        /// </summary>
        /// <param name="maximumEntryCount">How many Log Entries do you want to return?</param>
        /// <returns></returns>
        public IEnumerable <LogEntry> ReadLatestLogEntries(int maximumEntryCount = 100)
        {
            var results = _readService.GetLatestLogEntries(maximumEntryCount);

            return(results);
        }