示例#1
0
        public void Get_Publishers()
        {
            // Act
            var testPublishers = _publisherService.Get().ToList();

            // Assert
            Assert.AreEqual(4, testPublishers.Count);
            Assert.AreEqual("CompanyName1", testPublishers.First().CompanyName);
        }
示例#2
0
        // [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());
 }
示例#4
0
 public async Task DetailTest()
 {
     var id = 1;
     await publisherService.Get(id);
 }