예제 #1
0
        public void TestGetAuthorById()
        {
            var result = bll.GetAuthorById(1);

            Assert.AreEqual(1, result.AuthorId);
            result = bll.GetAuthorById(0);
            Assert.AreEqual(null, result);
        }
예제 #2
0
        public IHttpActionResult GetAuthorById(int authorid)
        {
            var author = _bll.GetAuthorById(authorid);

            if (author == null)
            {
                return(BadRequest());
            }
            return(Ok(author));
        }