public void QMWithNoConcats()
        {
            var q1 = new QMExtractorQueriable <ntup>();
            var r1 = q1.Count();

            var qm     = QMExtractorExecutor.LastQM;
            var qmList = ConcatSplitterQueryVisitor.Split(qm)
                         .DumpToConsole();

            Assert.AreEqual(1, qmList.Length);
            CheckForQuery(() => q1.Count(), qmList);
        }
        public void QMWith3Aggregate()
        {
            var q1  = new QMExtractorQueriable <TTreeQueryExecutorTest.TestNtupeArrD>();
            var q2  = new QMExtractorQueriable <TTreeQueryExecutorTest.TestNtupeArrD>();
            var q3  = new QMExtractorQueriable <TTreeQueryExecutorTest.TestNtupeArrD>();
            var seq = new IQueryable <TTreeQueryExecutorTest.TestNtupeArrD>[] { q1, q2, q3 };

            var all = seq.Skip(1).Aggregate(seq[0], (allc, next) => allc.Concat(next));
            var r   = all.Count();

            var qm     = QMExtractorExecutor.LastQM;
            var qmList = ConcatSplitterQueryVisitor.Split(qm)
                         .DumpToConsole();

            Assert.AreEqual(3, qmList.Length);
            CheckForQuery(() => q1.Count(), qmList, 3);
        }
        public void QMWith2SimpleConcats()
        {
            var q1 = new QMExtractorQueriable <ntup>();
            var q2 = new QMExtractorQueriable <ntup>();
            var r1 = q1.Concat(q2).Count();

            var qm     = QMExtractorExecutor.LastQM;
            var qmList = ConcatSplitterQueryVisitor.Split(qm)
                         .DumpToConsole();

            Assert.AreEqual(2, qmList.Length);
            CheckForQuery(() => q1.Count(), qmList, 2); // Can't really tell the difference between q1 and q2.

            // Make sure the query providers are correct! Since we don't care about the order.
            var providersUsed = ExtractProviders <ntup>(qmList);

            Assert.IsTrue(providersUsed.Contains(q1.Provider));
            Assert.IsTrue(providersUsed.Contains(q2.Provider));
            Assert.AreEqual(2, providersUsed.Count);
        }
        public void QMWith3EmbededConcat()
        {
            var q1 = new QMExtractorQueriable <ntup>();
            var q2 = new QMExtractorQueriable <ntup>();
            var q3 = new QMExtractorQueriable <ntup>();
            var r1 = q1.Concat(q2.Concat(q3)).Count();

            var qm     = QMExtractorExecutor.LastQM;
            var qmList = ConcatSplitterQueryVisitor.Split(qm)
                         .DumpToConsole();

            Assert.AreEqual(3, qmList.Length);
            CheckForQuery(() => q1.Count(), qmList, 3);

            // Make sure the query providers are correct! Since we don't care about the order.
            var providersUsed = ExtractProviders <ntup>(qmList);

            Assert.IsTrue(providersUsed.Contains(q1.Provider));
            Assert.IsTrue(providersUsed.Contains(q2.Provider));
            Assert.IsTrue(providersUsed.Contains(q3.Provider));
            Assert.AreEqual(3, providersUsed.Count);
        }