public void ArrayDefaults() { 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.defaults(uobj2); Console.WriteLine(uobj.ToJson()); Assert.AreEqual(@"[-1,1,-2,2,-3,3]", uobj.ToJson()); }
public void Defaults() { dynamic uobj = new UObj(); dynamic uobj2 = new UObj(); uobj.a = 1; uobj.b = 2; uobj2.a = 3; uobj2.c = 4; uobj.defaults(uobj2); Console.WriteLine(uobj.ToJson()); Assert.AreEqual(@"{""a"":1,""b"":2,""c"":4}", uobj.ToJson()); }