public void TestGetAuthorById() { var result = bll.GetAuthorById(1); Assert.AreEqual(1, result.AuthorId); result = bll.GetAuthorById(0); Assert.AreEqual(null, result); }
public IHttpActionResult GetAuthorById(int authorid) { var author = _bll.GetAuthorById(authorid); if (author == null) { return(BadRequest()); } return(Ok(author)); }