Example #1
0
        public IActionResult Search(string s)
        {
            if (string.IsNullOrEmpty(s))
            {
                return(View());
            }

            ViewBag.BlogTitle = _appSettings.HeaderBlogTitle;
            ViewBag.AboutTheSiteDescription = _localizer["AboutTheSiteContent"];

            var dataResponse = _cmsClient?.SearchPosts(s, int.MinValue, int.MaxValue);

            return(View(CommonConstants.Views.Index, dataResponse?.Data?.OrderByDescending(x => x.Published).ToList()));
        }
        public void SearchPosts_ShouldReturnPosts()
        {
            var posts = butterClient.SearchPosts(query: "api", page: 1, pageSize: 2);

            Assert.IsNotNull(posts);
        }