示例#1
0
        public void testType()
        {
            TCacheType obj = new TCacheType();

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

            obj.DataLong    = 22222222222222222L;
            obj.DataDecimal = 2.92M;
            obj.DataDouble  = 22222.2222222299;
            obj.Created     = DateTime.Now.AddDays(-2);

            obj.insert();

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

            Assert.AreEqual(1, list.Count);

            Assert.AreEqual(obj.Name, list[0].Name);
            Assert.AreEqual(obj.Address, list[0].Address);
            Assert.AreEqual(obj.IsDone, list[0].IsDone);

            Assert.AreEqual(obj.DataLong, list[0].DataLong);
            Assert.AreEqual(obj.DataDecimal, list[0].DataDecimal);
            Assert.AreEqual(obj.DataDouble, list[0].DataDouble);
            Assert.IsTrue(isTimeEqual(obj.Created, list[0].Created));
        }
示例#2
0
        public void testType()
        {
            TCacheType obj = new TCacheType();
            obj.Name = "n1";
            obj.Address = "a1";
            obj.IsDone = false;

            obj.DataLong = 22222222222222222L;
            obj.DataDecimal = 2.92M;
            obj.DataDouble = 22222.2222222299;
            obj.Created = DateTime.Now.AddDays( -2 );

            obj.insert();

            List<TCacheType> list = cdb.findAll<TCacheType>();
            Assert.AreEqual( 1, list.Count );

            Assert.AreEqual( obj.Name, list[0].Name );
            Assert.AreEqual( obj.Address, list[0].Address );
            Assert.AreEqual( obj.IsDone, list[0].IsDone );

            Assert.AreEqual( obj.DataLong, list[0].DataLong );
            Assert.AreEqual( obj.DataDecimal, list[0].DataDecimal );
            Assert.AreEqual( obj.DataDouble, list[0].DataDouble );
            Assert.IsTrue( isTimeEqual( obj.Created, list[0].Created ) );
        }