public void GetAllPublishers_WithNoSortBy_WithNoSearchString_WithNoPageNumber_Test() { var result = publishersServices.GetAllPublishers("", "", null); Assert.That(result.Count, Is.EqualTo(2)); Assert.AreEqual(result.Count, 2); }
public IActionResult GetAllPublishers(string sortBy, string searchString, int pageNumber) { // throw new Exception("This is an exeption throw from get all publishers"); try { _logger.LogInformation("This is just a log in GetAllPublishers()"); var _result = _publishersServices.GetAllPublishers(sortBy, searchString, pageNumber); return(Ok(_result)); } catch (Exception) { return(BadRequest("Sorry, we could not load the publishers!")); } }