Ejemplo n.º 1
0
 public void HtmlText_HasHtmlTags_TagsPreserved()
 {
     var content = "This has a <p> inside";
     var escapedContent = new XElement("test", content).FirstNode.ToString();
     var msg = new Message(XElement.Parse(@"<message guid='123' author='john' status='open' date='2009-07-18T23:53:04Z'>"
     +escapedContent+"</message>"));
     Assert.AreEqual(content, msg.GetSimpleHtmlText());
 }
Ejemplo n.º 2
0
 public void HtmlText_HasHtmlTagsAndData_GetJustHtml()
 {
     var content = "This has a <p> inside";
     // this would work, too: HttpUtility.HtmlEncode(content);
     var escapedContent = new XElement("test", content).FirstNode.ToString();
     var msg = new Message(XElement.Parse(@"<message guid='123' author='john' status='open' date='2009-07-18T23:53:04Z'>"
     + escapedContent + "<data>blah</data></message>"));
     Assert.AreEqual(content, msg.GetSimpleHtmlText());
 }
Ejemplo n.º 3
0
 public void HtmlText_HasOnlyData_GetEmptyString()
 {
     var msg = new Message(XElement.Parse(@"<message guid='123' author='john' status='open' date='2009-07-18T23:53:04Z'>"
     + "<data>blah</data></message>"));
     Assert.AreEqual(string.Empty, msg.GetSimpleHtmlText());
 }