public void Get_Publishers() { // Act var testPublishers = _publisherService.Get().ToList(); // Assert Assert.AreEqual(4, testPublishers.Count); Assert.AreEqual("CompanyName1", testPublishers.First().CompanyName); }
// [HttpPost] // public JsonResult validatePublisherName(string name) // { // return Json(!_context.Publisher.Any(publisher => publisher.name == name)); // } // GET: Publisher/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var publisher = await _publisherService.Get(id); if (publisher == null) { return(NotFound()); } return(View(publisher)); }
public ActionResult <List <Publisher> > Get() { return(_publisherService.Get()); }
public async Task DetailTest() { var id = 1; await publisherService.Get(id); }