public async Task <bool> TestFor_GetAll_BlogPost()
        {
            //Arrange
            var res = false;

            //Act
            service.Setup(repo => repo.GetAllPost());
            var result = await _blogPostServMock.GetAllPost();

            if (result != null)
            {
                res = true;
            }
            //Asert
            //final result displaying in text file
            await File.AppendAllTextAsync("../../../../output_exception_revised.txt", "TestFor_GetAll_BlogPost=" + res + "\n");

            return(res);
        }
Example #2
0
        /// <summary>
        /// Get all post and show on Index page
        /// </summary>
        /// <returns></returns>
        public async Task <IActionResult> Index()
        {
            IEnumerable <BlogPost> blogPosts = await _blogPostServ.GetAllPost();

            return(View(blogPosts));
        }