Example #1
0
        public void NetObject_Set_Property()
        {
            var point  = new Point(10, 5);
            var netObj = new NetObject(point);

            netObj.Set("X", new NetObject(-10));
            var x = netObj.Get("X");

            Assert.AreEqual(-10, x.ToObject());
        }
Example #2
0
        private IValue SetKey(List <IValue> arguments, Scope s)
        {
            ListNode       list   = (ListNode)arguments[0];
            NetObject      netObj = (NetObject)list.Children[1].Eval(s);
            IdentifierNode index  = (IdentifierNode)list.Children[2];
            IValue         value  = list.Children[3].Eval(s);

            netObj.Set(index.Name, value);

            return(value);
        }
Example #3
0
        public void NetObject_Set_Field()
        {
            string expected = "new string";
            var    ok       = new FieldClass {
                Ok = "old string"
            };
            var netObj = new NetObject(ok);

            netObj.Set("Ok", new NetObject(expected));
            var actual = netObj.Get("Ok");

            Assert.AreEqual(expected, actual.ToObject());
        }