示例#1
0
        public static void Aggregate_Product_Seed(Labeled <ParallelQuery <int> > labeled, int count, int start)
        {
            ParallelQuery <int> query = labeled.Item;

            // The operation will overflow for long-running sizes, but that's okay:
            // The helper is overflowing too!
            Assert.Equal(Functions.ProductRange(start, count), query.Aggregate(1L, (x, y) => x * y));
        }
示例#2
0
        public static void Aggregate_Product_SeedFunction(Labeled <ParallelQuery <int> > labeled, int count, int start)
        {
            ParallelQuery <int> query = labeled.Item;
            long actual = query.Aggregate(
                () => 1L,
                (accumulator, x) => accumulator * x,
                (left, right) => left * right,
                result => result + ResultFuncModifier);

            Assert.Equal(Functions.ProductRange(start, count) + ResultFuncModifier, actual);
        }
示例#3
0
        public static void Aggregate_Product_Result(Labeled <ParallelQuery <int> > labeled, int count, int start)
        {
            ParallelQuery <int> query = labeled.Item;

            Assert.Equal(Functions.ProductRange(start, count) + ResultFuncModifier, query.Aggregate(1L, (x, y) => x * y, result => result + ResultFuncModifier));
        }