public void ThrowsIfNowConstructorIsThere()
        {
            var original = new[] { 1 }.AsQueryable();
            var wrapped = ExtendedQueryable.Create(original);

            Assert.Throws <ArgumentException>(() => wrapped.New(42));
        }
        public void WorksLikeTheOriginal()
        {
            var original = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }.AsQueryable();
            var wrapped = ExtendedQueryable.Create(original);

            Assert.IsTrue(original.SequenceEqual(wrapped));
            Assert.IsTrue(original.SequenceEqual(wrapped.Select(n => n)));
            Assert.IsTrue(original.Where(n => n > 5).SequenceEqual(wrapped.Where(n => n > 5)));
            Assert.AreEqual(original.ElementType, wrapped.ElementType);
            Assert.AreEqual(original.Expression, wrapped.Expression);
        }
Exemple #3
0
 private void AssertNoChance(ExtendedQueryable <Person> query)
 {
     Assert.IsTrue(query.All(p => originalData.Contains(p)));
 }
 private void AssertNoChance(ExtendedQueryable<Person> query)
 {
     Assert.IsTrue(query.All(p=>originalData.Contains(p)));
 }
        private ExtendedQueryable <MoreComplexType> QueryableOfComplexType()
        {
            var original = new MoreComplexType[0].AsQueryable();

            return(ExtendedQueryable.Create(original));
        }