Ejemplo n.º 1
0
        public void GetLatestLogEntriesPage_ReturnsCorrectFirstPage()
        {
            // ARRANGE
            _writeService.WriteLog(LogType.Information, nameof(GetLatestLogEntriesPage_ReturnsCorrectFirstPage), null, "Test Log Entry 1", string.Empty);
            _writeService.WriteLog(LogType.Information, nameof(GetLatestLogEntriesPage_ReturnsCorrectFirstPage), null, "Test Log Entry 2", string.Empty);
            _writeService.WriteLog(LogType.Information, nameof(GetLatestLogEntriesPage_ReturnsCorrectFirstPage), null, "Test Log Entry 3", string.Empty);
            _writeService.WriteLog(LogType.Information, nameof(GetLatestLogEntriesPage_ReturnsCorrectFirstPage), null, "Test Log Entry 4", string.Empty);
            _writeService.WriteLog(LogType.Information, nameof(GetLatestLogEntriesPage_ReturnsCorrectFirstPage), null, "Test Log Entry 5", string.Empty);

            // ACT
            var logEntries = _readService.GetLatestLogEntriesPage(1, 1);

            // ASSERT
            Assert.IsTrue(logEntries.First().Message == "Test Log Entry 5");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get a paged list of the most recent Log Entries
        /// </summary>
        /// <param name="pageSize">How many Log Entries per page?</param>
        /// <param name="pageNumber">What page of Log Entries to return.</param>
        /// <returns></returns>
        public IEnumerable <LogEntry> ReadLatestLogEntriesByPage(int pageSize = 100, int pageNumber = 1)
        {
            var results = _readService.GetLatestLogEntriesPage(pageSize, pageNumber);

            return(results);
        }