Sidebar() private method

private Sidebar ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult
示例#1
0
        public void Comment_Length_Should_Less_Then_50()
        {
            FunctionalTestHelper.CreateAutomapperMap();
            FunctionalTestHelper.CreateAccountAndBlog(_dbContext);
            FunctionalTestHelper.CreateOnePost(_dbContext);
            FunctionalTestHelper.CreateOneCommenter(_dbContext);
            FunctionalTestHelper.CommentContent = "GreaterThan50GreaterThan50GreaterThan50GreaterThan50GreaterThan50";
            FunctionalTestHelper.CreateOneComment(_dbContext);

            _controller = new CommentController();

            var result = _controller.Sidebar() as ViewResult;

            result.ViewName.ShouldEqual("Sidebar");
            var model = result.Model as List<CommentSidebarViewModel>;
            model.ShouldNotBeNull();
            model.Count.ShouldEqual(1);
            model.First().Content.Length.ShouldEqual(50);
        }
示例#2
0
        public void Sidebar_Method_Should_Return_Comment()
        {
            FunctionalTestHelper.CreateAutomapperMap();
            FunctionalTestHelper.CreateAccountAndBlog(_dbContext);
            FunctionalTestHelper.CreateOnePost(_dbContext);
            FunctionalTestHelper.CreateOneCommenter(_dbContext);
            FunctionalTestHelper.CreateOneComment(_dbContext);

            _controller = new CommentController();

            var result = _controller.Sidebar() as ViewResult;

            result.ShouldNotBeNull();
            result.ViewName.ShouldEqual("Sidebar");
            var model = result.Model as List<CommentSidebarViewModel>;
            model.ShouldNotBeNull();
            model.Count.ShouldEqual(1);
        }