public void GetAll_WhenCalled_ReturnsOkOrNoContent()
        {
            var eventLogs = _service.EventLogs().ToList();
            var okResult  = _controller.GetAll();

            if (eventLogs.Any())
            {
                Assert.IsType <OkObjectResult>(okResult);
            }
            else
            {
                Assert.IsType <NoContentResult>(okResult);
            }
        }
Exemple #2
0
        public ActionResult GetAll()
        {
            var eventLog = _eventLogService.EventLogs().ToList();

            if (eventLog.Any())
            {
                return(Ok(eventLog));
            }
            else
            {
                return(NoContent());
            }
        }