public void TransformToHtml_WHEN_Token_IsStartingDelimeter_Is_True_And_IsEndingDelimeter_Is_False_THEN_Returns_Html_For_Image() { Token t = new Token(TokenType.Delimiter, "#a", 1, 1); t.IsStartingDelimeter = true; t.IsEndingDelimeter = false; var parseRule = new ImageParseRule(); string html = parseRule.TransformToHtml(t, new PropertyParseRule[0]); html.ShouldStartWith("<img"); }
public void TransformToHtml_WHEN_Token_IsStartingDelimter_Is_True_And_Has_Property_Named_Scr_THEN_Constructs_Anchor_Start_With_Src() { const string Src = "a.jpg"; dynamic t = new Token(TokenType.Delimiter, "#a", 1, 1); t.IsStartingDelimeter = true; t.IsEndingDelimeter = false; t.Src = Src; var parseRule = new ImageParseRule(); string html = parseRule.TransformToHtml(t, new PropertyParseRule[0]); html.ShouldEqual(String.Format("<img src='{0}'>", Src)); }