public void test_body_with_whitespaces_around() { ImageTag it = new ImageTag(); string bbcode = "[img] http://foobar [/img]"; string expected = "<img src=\"http://foobar\">"; string actual = BBCode.ToHtml(bbcode, new Dictionary<string, BaseTagHandler> { {"img", it} }); Assert.AreEqual(expected, actual); }
public void test_empty_body() { ImageTag it = new ImageTag(); string bbcode = "[img][/img]"; string expected = ""; string actual = BBCode.ToHtml(bbcode, new Dictionary<string, BaseTagHandler> { {"img", it} }); Assert.AreEqual(expected, actual); }
public void test_attributes() { ImageTag it = new ImageTag("style=\"display:none\""); string bbcode = "[img]foo[/img]"; string expected = "<img src=\"foo\" style=\"display:none\">"; string actual = BBCode.ToHtml(bbcode, new Dictionary<string, BaseTagHandler> { {"img", it} }); Assert.AreEqual(expected, actual); }
public void test_normal() { ImageTag it = new ImageTag(); string bbcode = "[img]http://some.url[/img]"; string expected = "<img src=\"http://some.url\">"; string actual = BBCode.ToHtml(bbcode, new Dictionary<string, BaseTagHandler> { {"img", it} }); Assert.AreEqual(expected, actual); }