Пример #1
0
        public void testProperty()
        {
            TProperty obj1 = new TProperty();

            obj1.Name    = "n1";
            obj1.Address = "a1";
            obj1.IsDone  = false;

            obj1.IsWrite = 99;
            obj1.Product = "product1";

            obj1.insert();

            TProperty obj2 = new TProperty();

            obj2.Name    = "n2";
            obj2.Address = "a2";
            obj2.IsDone  = true;

            obj2.IsWrite = 99;
            obj2.Product = "product1";

            obj2.insert();

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

            Assert.AreEqual(2, list.Count);

            Assert.AreEqual(obj1.Name, list[0].Name);
            Assert.AreEqual(obj1.Address, list[0].Address);
            Assert.AreEqual(obj1.IsDone, list[0].IsDone);
            Assert.AreEqual(66, list[0].IsRead);
            Assert.AreEqual("product1", list[0].Product);

            Assert.AreEqual(obj2.Name, list[1].Name);
            Assert.AreEqual(obj2.Address, list[1].Address);
            Assert.AreEqual(obj2.IsDone, list[1].IsDone);

            Assert.AreEqual(66, list[1].IsRead);
            Assert.AreEqual("product1", list[1].Product);
        }
Пример #2
0
        public void testProperty()
        {
            TProperty obj1 = new TProperty();
            obj1.Name = "n1";
            obj1.Address = "a1";
            obj1.IsDone = false;

            obj1.IsWrite = 99;
            obj1.Product = "product1";

            obj1.insert();

            TProperty obj2 = new TProperty();
            obj2.Name = "n2";
            obj2.Address = "a2";
            obj2.IsDone = true;

            obj2.IsWrite = 99;
            obj2.Product = "product1";

            obj2.insert();

            List<TProperty> list = cdb.findAll<TProperty>();
            Assert.AreEqual( 2, list.Count );

            Assert.AreEqual( obj1.Name, list[0].Name );
            Assert.AreEqual( obj1.Address, list[0].Address );
            Assert.AreEqual( obj1.IsDone, list[0].IsDone );
            Assert.AreEqual( 66, list[0].IsRead );
            Assert.AreEqual( "product1", list[0].Product );

            Assert.AreEqual( obj2.Name, list[1].Name );
            Assert.AreEqual( obj2.Address, list[1].Address );
            Assert.AreEqual( obj2.IsDone, list[1].IsDone );

            Assert.AreEqual( 66, list[1].IsRead );
            Assert.AreEqual( "product1", list[1].Product );
        }