예제 #1
0
        public void testList()
        {
            TCacheList obj = new TCacheList();

            obj.Address = new List <string> {
                "a1", "a3", "a6"
            };
            obj.IsDone = new List <bool> {
                true, false, false
            };

            obj.DataLong = new List <long> {
                22222222222222222L, 3333333333333333333L
            };
            obj.DataDecimal = new List <decimal> {
                2.92M, 883.666M
            };
            obj.DataDouble = new List <double> {
                22222.2222222299, 38132.5555555555
            };
            obj.Created = new List <DateTime> {
                DateTime.Now.AddDays(-2), DateTime.Now.AddDays(-5)
            };

            obj.insert();

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

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

            for (int i = 0; i < obj.Address.Count; i++)
            {
                Assert.AreEqual(obj.Address[i], x.Address[i]);
            }

            for (int i = 0; i < obj.IsDone.Count; i++)
            {
                Assert.AreEqual(obj.IsDone[i], x.IsDone[i]);
            }

            for (int i = 0; i < obj.DataLong.Count; i++)
            {
                Assert.AreEqual(obj.DataLong[i], x.DataLong[i]);
            }

            for (int i = 0; i < obj.DataDecimal.Count; i++)
            {
                Assert.AreEqual(obj.DataDecimal[i], x.DataDecimal[i]);
            }

            for (int i = 0; i < obj.DataDouble.Count; i++)
            {
                Assert.AreEqual(obj.DataDouble[i], x.DataDouble[i]);
            }

            for (int i = 0; i < obj.Created.Count; i++)
            {
                Assert.IsTrue(isTimeEqual(obj.Created[i], x.Created[i]));
            }
        }
예제 #2
0
        public void testList()
        {
            TCacheList obj = new TCacheList();
            obj.Address = new List<string> { "a1", "a3", "a6" };
            obj.IsDone = new List<bool> { true, false, false };

            obj.DataLong = new List<long> { 22222222222222222L, 3333333333333333333L };
            obj.DataDecimal = new List<decimal> { 2.92M, 883.666M };
            obj.DataDouble = new List<double> { 22222.2222222299, 38132.5555555555 };
            obj.Created = new List<DateTime> { DateTime.Now.AddDays( -2 ), DateTime.Now.AddDays( -5 ) };

            obj.insert();

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

            for (int i = 0; i < obj.Address.Count; i++) {
                Assert.AreEqual( obj.Address[i], x.Address[i] );
            }

            for (int i = 0; i < obj.IsDone.Count; i++) {
                Assert.AreEqual( obj.IsDone[i], x.IsDone[i] );
            }

            for (int i = 0; i < obj.DataLong.Count; i++) {
                Assert.AreEqual( obj.DataLong[i], x.DataLong[i] );
            }

            for (int i = 0; i < obj.DataDecimal.Count; i++) {
                Assert.AreEqual( obj.DataDecimal[i], x.DataDecimal[i] );
            }

            for (int i = 0; i < obj.DataDouble.Count; i++) {
                Assert.AreEqual( obj.DataDouble[i], x.DataDouble[i] );
            }

            for (int i = 0; i < obj.Created.Count; i++) {
                Assert.IsTrue( isTimeEqual( obj.Created[i], x.Created[i] ) );
            }
        }