public void brief_text_should_be_the_same_as_regula_text() { // arrange var post = new Post {Text = "this is mytext"}; // act & assert post.BriefText.Should().Be(post.Text); }
public void formatted_text_should_display_cs_code() { // arrange var post = new Post {Text = "[[code]this is my code[code]]"}; // act var displayText = post.DisplayText; // assert displayText.Should().Be(Post.CodePrefix + @"this is my code" + Post.CodeSuffix); }
public void display_text_should_not_contain_more_delimiter() { // arrange var moreDelimiter = "[|more|]"; var post = new Post {Text = "text" + moreDelimiter + "another text"}; // act var text = post.DisplayText; // assert text.Should().NotContain(moreDelimiter); }
public void brief_text_should_support_code_formatting(string moreDelimiter) { // arrange var post = new Post {Text = "test [[code] code [code]] end [|more|] the end"}; // act var briefText = post.BriefText; // assert briefText.Should().Be("test " + Post.CodePrefix + " code " + Post.CodeSuffix + " end "); }
public void should_show_brief_content(string moreDelimiter) { // arrange const string expected = "short"; var post = new Post {Text = expected + moreDelimiter + "long"}; // act var actual = post.BriefText; // assert Assert.Equal(expected, actual); }
/// <summary> /// Deprecated Method for adding a new object to the Posts EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToPosts(Post post) { base.AddObject("Posts", post); }
/// <summary> /// Create a new Post object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="text">Initial value of the Text property.</param> /// <param name="index">Initial value of the Index property.</param> /// <param name="posted">Initial value of the Posted property.</param> /// <param name="isDraft">Initial value of the IsDraft property.</param> public static Post CreatePost(global::System.Guid id, global::System.String title, global::System.String text, global::System.String index, global::System.DateTime posted, global::System.Boolean isDraft) { Post post = new Post(); post.ID = id; post.Title = title; post.Text = text; post.Index = index; post.Posted = posted; post.IsDraft = isDraft; return post; }
public void paragraphs_in_text_should_not_be_removed() { // arrange var text = "<p>this is text</p><p>with paragraphs</p>"; var post = new Post {Text = text}; // act var displayText = post.DisplayText; // assert displayText.Should().Be(text); }
public void paragraphs_in_code_should_be_removed() { // arrange var post = new Post {Text = "<p>[[code]void foo</p>\n<p><span style=\"white-space: pre;\"> </span>void Boo() {}</p>\n<p>}[code]]</p>"}; // act var displayText = post.DisplayText; // assert displayText.Should().Be("<p>" + Post.CodePrefix + "void foo\n\tvoid Boo() {}\n}" + Post.CodeSuffix + "</p>"); }