Exemple #1
0
        public static void RunTests()
        {
            LeftOperator[] leftOps = new LeftOperator[] {
                new LeftOperator("MakeCast", MakeCast, true),
                new LeftOperator("MakeConcat", MakeConcat, true),
                new LeftOperator("MakeDefaultIfEmpty", MakeDefaultIfEmpty, true),
                new LeftOperator("MakeDistinct", MakeDistinct, false),
                new LeftOperator("MakeExcept", MakeExcept, false),
                new LeftOperator("MakeGroupBy", MakeGroupBy, false),
                new LeftOperator("MakeGroupJoin", MakeGroupJoin, false),
                new LeftOperator("MakeIntersect", MakeIntersect, false),
                new LeftOperator("MakeJoin", MakeJoin, false),
                new LeftOperator("MakeOfType", MakeOfType, true),
                new LeftOperator("MakeOrderBy", MakeOrderBy, true),
                new LeftOperator("MakeOrderByThenBy", MakeOrderByThenBy, true),
                new LeftOperator("MakeReverse", MakeReverse, true),
                new LeftOperator("MakeSelect", MakeSelect, true),
                new LeftOperator("MakeSelectMany", MakeSelectMany, false),
                new LeftOperator("MakeSkip", MakeSkip, true),
                new LeftOperator("MakeSkipWhile", MakeSkipWhile, true),
                new LeftOperator("MakeSkipWhileIndexed", MakeSkipWhileIndexed, true),
                new LeftOperator("MakeTakeWhile", MakeTakeWhile, true),
                new LeftOperator("MakeTakeWhileIndexed", MakeTakeWhileIndexed, true),
                new LeftOperator("MakeUnion", MakeUnion, false),
                new LeftOperator("MakeWhere", MakeWhere, true),
                new LeftOperator("MakeWhereIndexed", MakeWhereIndexed, true),
                new LeftOperator("MakeZip", MakeZip, true)
            };

            TestTracker      result = new TestTracker();
            List <Exception> all_ex = new List <Exception>();

            foreach (bool orderPreserved in new bool[] { true, false })
            {
                foreach (LeftOperator leftOp in leftOps)
                {
                    String operatorName = leftOp.OperatorName;
                    Console.WriteLine("Left Operator={0}, Options={1}", operatorName, orderPreserved);
                    ParallelQuery <int> q = leftOp.LeftOperatorFactory(orderPreserved);
                    try
                    {
                        RunAllTests(result, q, orderPreserved, operatorName, leftOp.OrderDefined);
                    }
                    catch (Exception ex)
                    {
                        all_ex.Add(ex);
                    }
                }
            }

            if (all_ex.Count > 0)
            {
                throw new AggregateException(all_ex);
            }
        }
        internal static bool RunTests()
        {
            LeftOperator[] leftOps = new LeftOperator[] {
                new LeftOperator(MakeCast, true),
                new LeftOperator(MakeConcat, true),
                new LeftOperator(MakeDefaultIfEmpty, true),
                new LeftOperator(MakeDistinct, false),
                new LeftOperator(MakeExcept, false),
                new LeftOperator(MakeGroupBy, false),
                new LeftOperator(MakeGroupJoin, false),
                new LeftOperator(MakeIntersect, false),
                new LeftOperator(MakeJoin, false),
                new LeftOperator(MakeOfType, true),
                new LeftOperator(MakeOrderBy, true),
                new LeftOperator(MakeOrderByThenBy, true),
                new LeftOperator(MakeReverse, true),
                new LeftOperator(MakeSelect, true),
                new LeftOperator(MakeSelectMany, false),
                new LeftOperator(MakeSkip, true),
                new LeftOperator(MakeSkipWhile, true),
                new LeftOperator(MakeSkipWhileIndexed, true),
                new LeftOperator(MakeTakeWhile, true),
                new LeftOperator(MakeTakeWhileIndexed, true),
                new LeftOperator(MakeUnion, false),
                new LeftOperator(MakeWhere, true),
                new LeftOperator(MakeWhereIndexed, true),
                new LeftOperator(MakeZip, true)
            };

            TestTracker result = new TestTracker();

            foreach (bool orderPreserved in new bool[] { true, false })
            {
                foreach (LeftOperator leftOp in leftOps)
                {
                    String operatorName = leftOp.OperatorName;
                    TestHarness.TestLog("Left Operator={0}, Options={1}", operatorName, orderPreserved);
                    ParallelQuery <int> q = leftOp.LeftOperatorFactory(orderPreserved);

                    RunAllTests(result, q, orderPreserved, operatorName, leftOp.OrderDefined);
                }
            }
            return(result.Passed);
        }
Exemple #3
0
        public void UpdateLeft()
        {
            if (LeftOperator == null)
            {
                return;
            }

            if (!HasPriority)
            {
                return;
            }

            if (LeftOperator.HasPriority)
            {
                LeftOperator.Result = Result;
                LeftOperator.UpdateLeft();
            }
            else
            {
                LeftOperator.Right = Result;
            }
        }
Exemple #4
0
 double IOperator.Calculate()
 {
     return(LeftOperator.Calculate() * RigthOperator.Calculate());
 }