Example #1
0
        public void AddPropertyNullSingleProperty()
        {
            var    annon  = new { };
            string select = DynamicQueryable.AddProperties(annon.GetType(), typeof(SinglePropertyClass), new List <object>());

            Assert.AreEqual("new AutoPocoIO.test.Extensions.SinglePropertyClass()", select);
        }
Example #2
0
        public void AddPropertySinglePropertyWithCast()
        {
            var    annon  = new { Id = (int?)1 };
            string select = DynamicQueryable.AddProperties(annon.GetType(), typeof(SinglePropertyClass), new List <object>());

            Assert.AreEqual("new AutoPocoIO.test.Extensions.SinglePropertyClass(Int32(Id == null ? @0 : Id) as Id)", select);
        }
Example #3
0
        public void AddPropertyIntListProperty()
        {
            string select = DynamicQueryable.AddProperties(typeof(NestedIntListPropertyClass), typeof(NestedIntListPropertyClass), new List <object>());

            Assert.AreEqual("new AutoPocoIO.test.Extensions.NestedIntListPropertyClass(Id2 as Id2, OtherProp as OtherProp)", select);
        }
Example #4
0
        public void AddPropertyNoMatches()
        {
            string select = DynamicQueryable.AddProperties(typeof(NestedObjectPropertyClass), typeof(SinglePropertyClass), new List <object>());

            Assert.AreEqual("new AutoPocoIO.test.Extensions.SinglePropertyClass()", select);
        }