Esempio n. 1
0
        public HttpResponseMessage GetTopArticles()
        {
            var articles = Mapper.Map <IList <Article>, IList <ArticleViewModel> >(_articleManager.ListTopArticles());
            var response = Request.CreateResponse(HttpStatusCode.OK, articles);

            return(response);
        }
Esempio n. 2
0
        public void ListTop10()
        {
            IList <Article> articles = _articleManager.ListTopArticles();

            Assert.AreEqual(3, articles.Count);
            Assert.AreEqual(2, articles[0].Id);
            Assert.AreEqual(1, articles[1].Id);
            Assert.AreEqual(3, articles[2].Id);
        }
Esempio n. 3
0
        public ActionResult Index()
        {
            IList <ListArticlesViewModel> viewModel = Mapper.Map <IList <Article>, IList <ListArticlesViewModel> >(_articleManager.ListTopArticles());

            return(View(viewModel));
        }