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

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

            var q = queryable.Select(x => new
            {
                FirstProperty      = x.L1.L2.L3.L4.L5.Name,
                SecondProperty     = x.L1.L2,
                ConstantProperty   = 25,
                StringProeprty     = "Test",
                MethodCallProperty = Math.Abs(-69)
            });

            var res = q.First();

            res.FirstProperty.Should().Be(null);
            res.SecondProperty.Should().Be(null);
            res.ConstantProperty.Should().Be(25);
            res.StringProeprty.Should().Be("Test");
            res.MethodCallProperty.Should().Be(69);
        }
Beispiel #2
0
        public void EnumerableMoqqerQuery_Select_SingleNestedProperty()
        {
            var list = new List <Level0> {
                new Level0()
            };

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

            var q = queryable.Select(x => x.L1.L2.L3.L4.L5.Name);

            var res = q.FirstOrDefault();

            res.Should().Be(null);
        }
Beispiel #3
0
        public void EnumerableMoqqerQuery_Select_SingleLevel_IntoSinglePropertyAnnonymousType()
        {
            var list = new List <Level0> {
                new Level0()
            };

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

            var q = queryable.Select(x => new { SingleProperty = x.L1.L2.L3.L4.L5.Name });

            var res = q.First();

            res.SingleProperty.Should().Be(null);
        }