public void QMWithDifferentSourcesAndSelectMany() { var q1 = new QMExtractorQueriable <TTreeQueryExecutorTest.TestNtupe>(); var q2 = new QMExtractorQueriable <TTreeQueryExecutorTest.TestNtupeArrD>(); var dude = q2.SelectMany(e => e.myvectorofdouble).Select(i => (int)1).Concat(q1.Select(i => (int)1)).Count(); var qm = QMExtractorExecutor.LastQM; var qmList = ConcatSplitterQueryVisitor.Split(qm) .DumpToConsole(); Assert.AreEqual(2, qmList.Length); CheckForQuery(() => q1.Select(i => (int)1).Count(), qmList); CheckForQuery(() => q2.SelectMany(e => e.myvectorofdouble).Select(i => (int)1).Count(), qmList); // Make sure the query providers are correct! Since we don't care about the order. var providersUsed1 = ExtractProviders <TTreeQueryExecutorTest.TestNtupe>(qmList); var providersUsed2 = ExtractProviders <TTreeQueryExecutorTest.TestNtupeArrD>(qmList); foreach (var item in providersUsed2) { providersUsed1.Add(item); } Assert.AreEqual(2, providersUsed1.Count); Assert.IsTrue(providersUsed1.Contains(q1.Provider)); Assert.IsTrue(providersUsed1.Contains(q2.Provider)); }
public void WithConcatInSelectMany() { var q1 = new QMExtractorQueriable <TTreeQueryExecutorTest.TestNtupe>(); var q2 = new QMExtractorQueriable <TTreeQueryExecutorTest.TestNtupeArrD>(); var dude = q2.SelectMany(e => e.myvectorofdouble.Select(i => (int)1).Concat(q1.Select(eb => (int)1))).Count(); var qm = QMExtractorExecutor.LastQM; var QMList = ConcatSplitterQueryVisitor.Split(qm) .DumpToConsole(); Assert.AreEqual(2, QMList.Length); }