public void BackSlashWithT()
        {
            var serialized = SimpleJson.SerializeObject("c:\\taha.pl");
            var result     = SimpleJson.EscapeToJavascriptString(serialized);

            Assert.AreEqual("\"c:\\taha.pl\"", result);
        }
Exemplo n.º 2
0
        public void EscapeToJavascriptString_should_not_double_escape()
        {
            string preformattedString = "{ \"name\" : \"value\" }";
            int    expectedSlashCount = preformattedString.Count(x => x == '\\');

            string result           = SimpleJson.EscapeToJavascriptString(preformattedString);
            int    actualSlashCount = result.Count(x => x == '\\');

            Assert.AreEqual(expectedSlashCount, actualSlashCount);
        }