Esempio n. 1
0
        public void testArray()
        {
            TCacheArray obj = new TCacheArray();

            obj.Address = new string[] { "a1", "a3", "a6" };
            obj.IsDone  = new bool[] { true, false, false };

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

            obj.insert();

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

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

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

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

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

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

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

            for (int i = 0; i < obj.Created.Length; i++)
            {
                Assert.IsTrue(isTimeEqual(obj.Created[i], x.Created[i]));
            }
        }
Esempio n. 2
0
        public void testArray()
        {
            TCacheArray obj = new TCacheArray();
            obj.Address = new string[] { "a1", "a3", "a6" };
            obj.IsDone = new bool[] { true, false, false };

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

            obj.insert();

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

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

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

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

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

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

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