示例#1
0
    public static SqlDouble Average(string jsonData, string expression)
    {
        var average = JSONQuery.GetAvg(jsonData, expression);

        if (average != null)
        {
            return(new SqlDouble(average.Value));
        }
        return(new SqlDouble());
    }
示例#2
0
        public void When_element_not_able_to_aggregated_return_null(string expression)
        {
            var found = JSONQuery.GetAvg(JsonTestData, expression);

            Assert.IsNull(found);
        }
示例#3
0
        public void When_element_in_chain_of_arrays_requested_return_average_of_all_values(string expression, double expected)
        {
            var found = JSONQuery.GetAvg(JsonTestData, expression);

            Assert.AreEqual(expected, found.Value);
        }