예제 #1
0
 public void NestedClassShouldBeAbleToGetValue()
 {
     var pocoData = new PocoDataFactory(new MapperCollection()).ForType(typeof(ComplexMap));
     var obj = new ComplexMap()
     {
         Name = "Bill",
         NestedComplexMap = new NestedComplexMap()
         {
             Id = 9
         }
     };
     var val = pocoData.Columns["NestedComplexMap__Id"].GetValue(obj);
     Assert.AreEqual(9, val);
 }
예제 #2
0
        public void NestedClassShouldBeAbleToGetValue()
        {
            var pocoData = new PocoDataFactory(new MapperCollection()).ForType(typeof(ComplexMap));
            var obj      = new ComplexMap()
            {
                Name             = "Bill",
                NestedComplexMap = new NestedComplexMap()
                {
                    Id = 9
                }
            };
            var val = pocoData.Columns["NestedComplexMap__Id"].GetValue(obj);

            Assert.AreEqual(9, val);
        }
예제 #3
0
        public void ProjectToComplexColumn()
        {
            var obj = new ComplexMap()
            {
                Name = "Bill",
                NestedComplexMap2 = new NestedComplexMap2()
                {
                    Id   = 9,
                    Name = "Silly"
                }
            };

            Database.Insert(obj);
            var results = Database.Query <ComplexMap>().ProjectTo(x => x.NestedComplexMap2).Single();

            Assert.AreEqual(obj.NestedComplexMap2.Id, results.Id);
            Assert.AreEqual(obj.NestedComplexMap2.Name, results.Name);
        }
예제 #4
0
        public void Test1()
        {
            var obj = new ComplexMap()
            {
                Name             = "Bill",
                NestedComplexMap = new NestedComplexMap()
                {
                    Id = 9,
                    NestedComplexMap2 = new NestedComplexMap2()
                    {
                        Id = 18
                    }
                }
            };

            Database.Insert(obj);
            var results = Database.Fetch <ComplexMap>().Single();

            Assert.AreEqual(obj.Id, results.Id);
            Assert.AreEqual(obj.Name, results.Name);
            Assert.AreEqual(obj.NestedComplexMap.Id, results.NestedComplexMap.Id);
            Assert.AreEqual(obj.NestedComplexMap.NestedComplexMap2.Id, results.NestedComplexMap.NestedComplexMap2.Id);
        }
예제 #5
0
 public void Test1()
 {
     var obj = new ComplexMap()
     {
         Name = "Bill",
         NestedComplexMap = new NestedComplexMap()
         {
             Id = 9,
             NestedComplexMap2 = new NestedComplexMap2()
             {
                 Id = 18
             }
         }
     };
     Database.Insert(obj);
     var results = Database.Fetch<ComplexMap>().Single();
     Assert.AreEqual(obj.Id, results.Id);
     Assert.AreEqual(obj.Name, results.Name);
     Assert.AreEqual(obj.NestedComplexMap.Id, results.NestedComplexMap.Id);
     Assert.AreEqual(obj.NestedComplexMap.NestedComplexMap2.Id, results.NestedComplexMap.NestedComplexMap2.Id);
 }
예제 #6
0
 public void ProjectToComplexColumn()
 {
     var obj = new ComplexMap()
     {
         Name = "Bill",
         NestedComplexMap2 = new NestedComplexMap2()
         {
             Id = 9,
             Name = "Silly"
         }
     };
     Database.Insert(obj);
     var results = Database.Query<ComplexMap>().ProjectTo(x => x.NestedComplexMap2).Single();
     Assert.AreEqual(obj.NestedComplexMap2.Id, results.Id);
     Assert.AreEqual(obj.NestedComplexMap2.Name, results.Name);
 }