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 UnescapeHtml() { StringOperators.UnescapeHtml(""Me < Me & Jou, Jou > Me.", said he.").Should().Be("\"Me < Me & Jou, Jou > Me.\", said he."); StringOperators.FpUnescape("1 < 5", "html").Should().Be("1 < 5"); }
public void UnescapeJson() { StringOperators.UnescapeJson("hi\\t\\\"there\\\"! \\\\/").Should().Be("hi\t\"there\"! \\/"); StringOperators.FpUnescape("hi\\nthere", "json").Should().Be("hi\nthere"); }