Exemplo n.º 1
0
        public void testSubObject()
        {
            TCacheSub obj = new TCacheSub();

            obj.Address = "a1";
            obj.IsDone  = true;

            obj.Sub        = new TCacheChild();
            obj.Sub.Id     = 33;
            obj.Sub.Name   = "s1";
            obj.Sub.Weight = 88;

            obj.insert();


            List <TCacheSub> list = cdb.findAll <TCacheSub>();

            Assert.AreEqual(1, list.Count);
            TCacheSub x = list[0];

            Assert.AreEqual(obj.Name, x.Name);
            Assert.AreEqual(obj.Address, x.Address);
            Assert.AreEqual(obj.IsDone, x.IsDone);

            Assert.IsNotNull(x.Sub);
            Assert.AreEqual(obj.Sub.Id, x.Sub.Id);
            Assert.AreEqual(obj.Sub.Name, x.Sub.Name);
            Assert.AreEqual(obj.Sub.Weight, x.Sub.Weight);
        }
Exemplo n.º 2
0
        public void testSubObject()
        {
            TCacheSub obj = new TCacheSub();
            obj.Address = "a1";
            obj.IsDone = true;

            obj.Sub = new TCacheChild();
            obj.Sub.Id = 33;
            obj.Sub.Name = "s1";
            obj.Sub.Weight = 88;

            obj.insert();

            List<TCacheSub> list = cdb.findAll<TCacheSub>();
            Assert.AreEqual( 1, list.Count );
            TCacheSub x = list[0];

            Assert.AreEqual( obj.Name, x.Name );
            Assert.AreEqual( obj.Address, x.Address );
            Assert.AreEqual( obj.IsDone, x.IsDone );

            Assert.IsNotNull( x.Sub );
            Assert.AreEqual( obj.Sub.Id, x.Sub.Id );
            Assert.AreEqual( obj.Sub.Name, x.Sub.Name );
            Assert.AreEqual( obj.Sub.Weight, x.Sub.Weight );
        }