Beispiel #1
0
        public void CountAllValue()
        {
            var source = TestData.GetNullableInts();
            int result = source.QueryScalar <int?, int>("SELECT count(ALL value()) FROM this");

            Assert.IsTrue(result == source.Where(i => i.HasValue).Count());
        }
        public void StdevPNullableInt()
        {
            IEnumerable <int?> source = TestData.GetNullableInts();

            double?result = source.QueryScalar <int?, double?>("SELECT StdevP(value()) FROM this");

            Assert.AreEqual((double)result, 1.479019945774904, double.Epsilon);
        }
        public void StdevNullableInt()
        {
            IEnumerable <int?> source = TestData.GetNullableInts();

            double?result = source.QueryScalar <int?, double?>("SELECT Stdev(value()) FROM this");

            Assert.AreEqual((double)result, 1.707825127659933, double.Epsilon);
        }
Beispiel #4
0
        public void VarPNullableInt()
        {
            IEnumerable <int?> source = TestData.GetNullableInts();

            double?result = source.QueryScalar <int?, double?>("SELECT varp(value()) FROM this");

            Assert.AreEqual((double)result, 2.1875, double.Epsilon);
        }
Beispiel #5
0
        public void CountDistinctIgnoresNullValues()
        {
            var source        = TestData.GetNullableInts();
            var nonNUllSource = source.Where(i => i.HasValue).Select(i => (int)i);
            int result        = nonNUllSource.QueryScalar <int>("SELECT count(DISTINCT value()) FROM this");
            int nullResults   = source.QueryScalar <int?, int>("SELECT count(DISTINCT value()) FROM this");

            Assert.IsTrue(result == nullResults);
        }