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); }
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); }