public void Escape()
        {
            string result0 = JsonFormatUtility.Escape(m_unescaped);
            string result1 = JsonFormatUtility.Escape("http://placehold.it/32x32");

            Assert.AreEqual(m_escaped, result0);
            Assert.AreEqual("http://placehold.it/32x32", result1);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates string from the specified value.
        /// <para>
        /// The specified value will be escaped.
        /// </para>
        /// </summary>
        /// <param name="value">The value.</param>
        public static JsonValue CreateString(string value)
        {
            value = JsonFormatUtility.Escape(value);

            return(new JsonValue(JsonValueType.String, value));
        }