public async void GetUserEventLogsReturnsNoneTest() { var eventLogController = new EventLogsController(_dbContext, _repo); IActionResult userEventLogs = await eventLogController.GetUserEventLog(2); OkObjectResult intermediate = userEventLogs as OkObjectResult; List <EventLog> result = intermediate.Value as List <EventLog>; // Assert Assert.True(result.Count == 0); }
public async void GetUserEventLogsReturnsTwoTest() { var eventLogController = new EventLogsController(_dbContext, _repo); var user = _dbContext.Users.FirstAsync(x => x.Id == 1); IActionResult userEventLogs = await eventLogController.GetUserEventLog(user.Id); OkObjectResult intermediate = userEventLogs as OkObjectResult; List <EventLog> result = intermediate.Value as List <EventLog>; // Assert Assert.True(result.Count == 2); }