public void Logs_Contain_Correct_Error_Count()
        {
            var numberOfErrors = _logViewer.GetNumberOfErrors(startDate: _startDate, endDate: _endDate);

            //Our dummy log should contain 2 errors
            Assert.AreEqual(2, numberOfErrors);
        }
Esempio n. 2
0
        public void Logs_Contain_Correct_Error_Count()
        {
            var numberOfErrors = _logViewer.GetNumberOfErrors(_logTimePeriod);

            // Our dummy log should contain 2 errors
            Assert.AreEqual(1, numberOfErrors);
        }
        public int GetNumberOfErrors()
        {
            //We will need to stop the request if trying to do this on a 1GB file
            if (CanViewLogs() == false)
            {
                throw new HttpResponseException(Request.CreateNotificationValidationErrorResponse("Unable to view logs, due to size"));
            }

            return(_logViewer.GetNumberOfErrors(startDate: DateTime.Now.AddDays(-1), endDate: DateTime.Now));
        }
Esempio n. 4
0
        public ActionResult <int> GetNumberOfErrors([FromQuery] DateTime?startDate = null, [FromQuery] DateTime?endDate = null)
        {
            var logTimePeriod = GetTimePeriod(startDate, endDate);

            //We will need to stop the request if trying to do this on a 1GB file
            if (CanViewLogs(logTimePeriod) == false)
            {
                return(ValidationProblem("Unable to view logs, due to size"));
            }

            return(_logViewer.GetNumberOfErrors(logTimePeriod));
        }
Esempio n. 5
0
        public int GetNumberOfErrors([FromUri] DateTime?startDate = null, [FromUri] DateTime?endDate = null)
        {
            var logTimePeriod = GetTimePeriod(startDate, endDate);

            //We will need to stop the request if trying to do this on a 1GB file
            if (CanViewLogs(logTimePeriod) == false)
            {
                throw new HttpResponseException(Request.CreateNotificationValidationErrorResponse("Unable to view logs, due to size"));
            }

            return(_logViewer.GetNumberOfErrors(logTimePeriod));
        }