public void Escape_Unescape_Roundtrip(string text) { var escaped = BBCode.EscapeText(text); var unescaped = BBCode.UnescapeText(escaped); Assert.Equal(text, unescaped); }
public void Escape_Unescape_Roundtrip([PexAssumeNotNull] string text) { var escaped = BBCode.EscapeText(text); var unescaped = BBCode.UnescapeText(escaped); Assert.AreEqual(text, unescaped); }
public void Escape_Parse_ToText_Roundtrip(string text) { var escaped = BBCode.EscapeText(text); var unescaped = GetSimpleParser().ParseSyntaxTree(escaped); var text2 = unescaped.ToText(); Assert.Equal(text, text2); }
public void EscapedStringIsSafeForParsing(string text) { var escaped = BBCode.EscapeText(text); var ast = GetSimpleParser().ParseSyntaxTree(escaped); if (text.Length == 0) { Assert.Equal(0, ast.SubNodes.Count); } else { Assert.Equal(text, ((TextNode)ast.SubNodes.Single()).Text); } }
public void Escape_NoCrash() { BBCode.EscapeText(RandomValue.String()); }
public void Escape_NoCrash([PexAssumeNotNull] string text, out string escaped) { escaped = BBCode.EscapeText(text); }