Example #1
0
        public void NewsLogic_GetPage()
        {
            //Act
            NewsPage page = _newsLogic.GetNewsPage(1, Language.Rus);

            //Assert
            Assert.AreEqual(page.Language, Language.Rus);
            Assert.AreEqual(page.Count, 20);
            Assert.IsTrue(page.MoreRecords);
            Assert.IsTrue(page.All(record => record.Language == Language.Rus));
            Assert.IsFalse(page.All(record => record.News.AllowAnonymous));
        }
        /// <summary>
        /// Запрос страницы новостей
        /// </summary>
        /// <param name="pageNumber"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        public ActionResult NewsPage(int pageNumber, Language?language = null)
        {
            NewsPage page = _newsLogic.GetNewsPage(pageNumber, language ?? Language);

            return(PartialView(new NewsPageModel(page, AuthenticationData.IsAdministrator)));
        }