Exemple #1
0
 public virtual void TestQuoting()
 {
     Assert.Equal("ab&lt;cd", HtmlQuoting.QuoteHtmlChars("ab<cd"));
     Assert.Equal("ab&gt;", HtmlQuoting.QuoteHtmlChars("ab>"));
     Assert.Equal("&amp;&amp;&amp;", HtmlQuoting.QuoteHtmlChars("&&&"
                                                                ));
     Assert.Equal(" &apos;\n", HtmlQuoting.QuoteHtmlChars(" '\n"));
     Assert.Equal("&quot;", HtmlQuoting.QuoteHtmlChars("\""));
     Assert.Equal(null, HtmlQuoting.QuoteHtmlChars(null));
 }
Exemple #2
0
 /// <exception cref="System.Exception"/>
 private void RunRoundTrip(string str)
 {
     Assert.Equal(str, HtmlQuoting.UnquoteHtmlChars(HtmlQuoting.QuoteHtmlChars
                                                        (str)));
 }
Exemple #3
0
 /// <exception cref="System.IO.IOException"/>
 public override void Write(int b)
 {
     this.data[0] = unchecked ((byte)b);
     HtmlQuoting.QuoteHtmlChars(@out, this.data, 0, 1);
 }
Exemple #4
0
 /// <exception cref="System.IO.IOException"/>
 public override void Write(byte[] data, int off, int len)
 {
     HtmlQuoting.QuoteHtmlChars(@out, data, off, len);
 }