void CreateFunctions() { connection.CreateFunction( "JSON", 2, new Function((arguments) => JsonCollator.Compare( JsonCollationMode.Unicode, (string)arguments [0], (string)arguments [1], Int32.MaxValue)), true); connection.CreateFunction( "JSON_ASCII", 2, new Function((arguments) => JsonCollator.Compare( JsonCollationMode.Ascii, (string)arguments [0], (string)arguments [1], Int32.MaxValue)), true); connection.CreateFunction( "JSON_RAW", 2, new Function((arguments) => JsonCollator.Compare( JsonCollationMode.Raw, (string)arguments [0], (string)arguments [1], Int32.MaxValue)), true); }
private void TestCollateConvertEscape(String input, char decoded) { //TODO : How to test private methods. int endPos; char result = JsonCollator.ConvertEscape(input, 0, out endPos); Assert.AreEqual(decoded, result); Assert.AreEqual(input.Length - 1, endPos); }
private static double ReadNumber(String str, int start, out int endOfNumber) { return(JsonCollator.Strtod(str, start, out endOfNumber)); }
private static void TestCollateEquals(JsonCollationMode mode, String input1, String input2, int arrayLimit, int expectedValue) { int result = JsonCollator.Compare(mode, input1, input2, arrayLimit); Assert.AreEqual(expectedValue, result); }