public void UnknownEscape() { Action act = () => StringOperators.FpEscape("Ewout", "reverse_polish"); act.Should().Throw <ArgumentException>().Which.Message.StartsWith("Unknown escaping method 'reverse_polish'."); act = () => StringOperators.FpUnescape("Ewout", "reverse_polish"); act.Should().Throw <ArgumentException>().Which.Message.StartsWith("Unknown escaping method 'reverse_polish'."); }
public void EscapeJson() { StringOperators.EscapeJson("hi\t\"there\"! \\/").Should().Be("hi\\t\\\"there\\\"! \\\\/"); StringOperators.FpEscape("hi\nthere", "json").Should().Be("hi\\nthere"); }
public void EscapeHtml() { StringOperators.EscapeHtml("\"Me < Me & Jou, Jou > Me.\", said he.").Should().Be(""Me < Me & Jou, Jou > Me.", said he."); StringOperators.FpEscape("1 < 5", "html").Should().Be("1 < 5"); }