public virtual void TestCollateASCII() { int mode = kTDCollateJSON_ASCII; NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "true", 0, "false")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "false" , 0, "true")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "null" , 0, "17")); NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "123", 0, "1")); NUnit.Framework.Assert.AreEqual(0, TDCollateJSON.TestCollateJSON(mode, 0, "123", 0, "0123.0")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "123", 0, "\"123\"")); NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "\"1234\"" , 0, "\"123\"")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "\"1234\"" , 0, "\"1235\"")); NUnit.Framework.Assert.AreEqual(0, TDCollateJSON.TestCollateJSON(mode, 0, "\"1234\"" , 0, "\"1234\"")); NUnit.Framework.Assert.AreEqual(0, TDCollateJSON.TestCollateJSON(mode, 0, "\"12\\/34\"" , 0, "\"12/34\"")); NUnit.Framework.Assert.AreEqual(0, TDCollateJSON.TestCollateJSON(mode, 0, "\"\\/1234\"" , 0, "\"/1234\"")); NUnit.Framework.Assert.AreEqual(0, TDCollateJSON.TestCollateJSON(mode, 0, "\"1234\\/\"" , 0, "\"1234/\"")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "\"A\"" , 0, "\"a\"")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "\"B\"" , 0, "\"a\"")); }
public virtual void TestCollateNestedArray() { int mode = kTDCollateJSON_Unicode; NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "[[]]", 0, "[]")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "[1,[2,3],4]" , 0, "[1,[2,3.1],4,5,6]")); }
public virtual void TestCollateUnicodeStrings() { int mode = kTDCollateJSON_Unicode; NUnit.Framework.Assert.AreEqual(0, TDCollateJSON.TestCollateJSON(mode, 0, Encode( "frÔøΩd"), 0, Encode("frÔøΩd"))); // Assert.assertEquals(1, TDCollateJSON.testCollateJSON(mode, 0, encode("ÔøΩmÔøΩ"), 0, encode("omo"))); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, Encode ("\t"), 0, Encode(" "))); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, Encode ("\x1"), 0, Encode(" "))); }
public virtual void TestCollateRaw() { int mode = kTDCollateJSON_Raw; NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "false" , 0, "17")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "false" , 0, "true")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "null" , 0, "true")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "[\"A\"]" , 0, "\"A\"")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "\"A\"" , 0, "\"a\"")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "[\"b\"]" , 0, "[\"b\",\"c\",\"a\"]")); }
public virtual void TestCollateArrays() { int mode = kTDCollateJSON_Unicode; NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "[]", 0 , "\"foo\"")); NUnit.Framework.Assert.AreEqual(0, TDCollateJSON.TestCollateJSON(mode, 0, "[]", 0 , "[]")); NUnit.Framework.Assert.AreEqual(0, TDCollateJSON.TestCollateJSON(mode, 0, "[true]" , 0, "[true]")); NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "[false]" , 0, "[null]")); NUnit.Framework.Assert.AreEqual(-1, TDCollateJSON.TestCollateJSON(mode, 0, "[]", 0, "[null]")); NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "[123]" , 0, "[45]")); NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "[123]" , 0, "[45,67]")); NUnit.Framework.Assert.AreEqual(1, TDCollateJSON.TestCollateJSON(mode, 0, "[123.4,\"wow\"]" , 0, "[123.40,789]")); }