Beispiel #1
0
        public void EnumerableMoqqerQuery_Where_ExpressionType_GreaterThan_SingleLevel()
        {
            var list = new List <Level0> {
                new Level0()
            };

            var queryable = new EnumerableMoqqerQuery <Level0>(list);

            var q = queryable.Where(x => x.L1.L2.L3.L4.L5.Decimal > 25);

            var res = q.FirstOrDefault();

            res.Should().BeNull("single level does not have non null references until decimal");
        }
Beispiel #2
0
        public void EnumerableMoqqerQuery_Where_ExpressionType_GreaterThan_AllLevels()
        {
            var list = new List <Level0> {
                AllLevels
            };

            var queryable = new EnumerableMoqqerQuery <Level0>(list);

            var q = queryable.Where(x => x.L1.L2.L3.L4.L5.Decimal > 25);

            var res = q.FirstOrDefault();

            res.Should().NotBeNull("All Levels has decimal of 100");
        }
Beispiel #3
0
        public void EnumerableMoqqerQuery_Where_ExpressionType_Equal_SingleLevel()
        {
            var list = new List <Level0> {
                new Level0()
            };

            var queryable = new EnumerableMoqqerQuery <Level0>(list);

            // ReSharper disable once ReplaceWithSingleCallToFirstOrDefault
            var q = queryable.Where(x => x.L1.L2.L3.L4.L5.Name == "Name");

            var res = q.FirstOrDefault();

            res.Should().BeNull("as deepest level doesn't even exist");
        }
Beispiel #4
0
        public void EnumerableMoqqerQuery_Where_ExpressionType_Equal_AllLevels_ComaprisonReturnsTrue()
        {
            var list = new List <Level0> {
                AllLevels
            };

            var queryable = new EnumerableMoqqerQuery <Level0>(list);

            // ReSharper disable once ReplaceWithSingleCallToFirstOrDefault
            var q = queryable.Where(x => x.L1.L2.L3.L4.L5.Name == "Name");

            var res = q.FirstOrDefault();

            res.Should().NotBeNull();
        }
Beispiel #5
0
        public void EnumerableMoqqerQuery_Where_ExpressionType_LessThanOrEqual_SingleLevel()
        {
            var list = new List <Level0> {
                new Level0()
            };

            var queryable = new EnumerableMoqqerQuery <Level0>(list);

            // ReSharper disable once ReplaceWithSingleCallToFirstOrDefault
            var q = queryable.Where(x => x.L1.L2.L3.L4.L5.Decimal <= 25);

            var res = q.FirstOrDefault();

            res.Should().BeNull("single level.");
        }