public void GivenATitle_WhenItIs59CharsLong_ThenIGetBackTheWholeTitle() { string title = "12345678901234567890123456789012345678901234567890123456789"; var model = new AdminBlogViewModel(); model.Title = title; Assert.That(model.Title.Length, Is.EqualTo(59)); }
public virtual ActionResult ListPosts(AdminBlogViewModel model) { var blog = _blogService.GetBlog(model.Nickname); IList <Post> posts = _postService.GetOrderedBlogPosts(blog.Id); var postsViewModel = new PostsViewModel(model.Nickname, posts); return(View(postsViewModel)); }
public void GivenATitle_WhenItIsMoreThan60CharsLong_ThenIGetBackTheFirst57CharsAndThenDots() { string title = "1234567890123456789012345678901234567890123456789012345678901234567890"; var model = new AdminBlogViewModel(); model.Title = title; Assert.That(model.Title.Length, Is.EqualTo(60)); Assert.That(model.Title, Is.StringEnding("...")); }