Exemple #1
0
        public void ArrayExtend()
        {
            dynamic uobj  = new UObj();
            dynamic uobj2 = new UObj();

            uobj.push(null, 1, null, 2, null, 3);
            uobj2.push(-1, 2, -2, null, -3, 4);
            uobj.extend(uobj2);
            Console.WriteLine(uobj.ToJson());
            Assert.AreEqual(@"[-1,2,-2,null,-3,4]", uobj.ToJson());
        }
Exemple #2
0
        public void Extend()
        {
            dynamic uobj  = new UObj();
            dynamic uobj2 = new UObj();

            uobj.a  = 1;
            uobj.b  = 2;
            uobj2.a = 3;
            uobj2.c = 4;
            uobj.extend(uobj2);
            Console.WriteLine(uobj.ToJson());
            Assert.AreEqual(@"{""a"":3,""b"":2,""c"":4}", uobj.ToJson());
        }