Exemplo n.º 1
0
        public void TestGetAuthorByArticleId()
        {
            var result = bll.GetReviewsByArticleId(1);

            Assert.AreEqual(1, result.FirstOrDefault().ReviewId);
            result = bll.GetReviewsByArticleId(2);
            Assert.AreEqual(null, result.FirstOrDefault());
        }
Exemplo n.º 2
0
        public IHttpActionResult GetReviewsByArticleId(int articleId)
        {
            var reviews = _bll.GetReviewsByArticleId(articleId);

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