public void SingleIntersectWithNoOverlap()
        {
            CustomerCollection coll = new CustomerCollection();
            coll.es.Connection.Name = "ForeignKeyTest";

            CustomerQuery cq1 = new CustomerQuery("c1");
            cq1.SelectAllExcept(cq1.Notes);
            cq1.Where(cq1.DateAdded.Between(Convert.ToDateTime("2005-01-01"), Convert.ToDateTime("2005-12-31")));

            CustomerQuery cq2 = new CustomerQuery("c2");
            cq2.SelectAllExcept(cq2.Notes);
            cq2.Where(cq2.DateAdded.Between(Convert.ToDateTime("2006-01-01"), Convert.ToDateTime("2006-12-31")));

            // There is no intersection for 2005 and 2006
            cq1.Intersect(cq2);

            Assert.IsFalse(coll.Load(cq1));
            Assert.AreEqual(0, coll.Count);
        }
        public void SingleIntersect()
        {
            CustomerCollection coll = new CustomerCollection();
            coll.es.Connection.Name = "ForeignKeyTest";

            CustomerQuery cq1 = new CustomerQuery("c1");
            cq1.SelectAllExcept(cq1.Notes);
            cq1.Where(cq1.DateAdded.Between(Convert.ToDateTime("2005-01-01"), Convert.ToDateTime("2005-12-31")));

            CustomerQuery cq2 = new CustomerQuery("c2");
            cq2.SelectAllExcept(cq2.Notes);
            cq2.Where(cq2.DateAdded.Between(Convert.ToDateTime("2005-12-31"), Convert.ToDateTime("2006-12-31")));

            // Only the 2 rows for 2005-12-31
            cq1.Intersect(cq2);

            Assert.IsTrue(coll.Load(cq1));
            Assert.AreEqual(2, coll.Count);
        }