public void SetAttributeInNativeObject()
        {
            BindingEnvironment environment = new BindingEnvironment();
            Person adam = new Person();
            environment.SetValue("adam", adam);

            SetAttributeCommand command = new SetAttributeCommand(new NameExpression("adam"), "FirstName", new ConstantExpression("Adam"));

            command.Execute(environment);

            Assert.AreEqual("Adam", adam.FirstName);
        }
        public void SetAttributeInNativeObject()
        {
            BindingEnvironment environment = new BindingEnvironment();
            Person             adam        = new Person();

            environment.SetValue("adam", adam);

            SetAttributeCommand command = new SetAttributeCommand(new NameExpression("adam"), "FirstName", new ConstantExpression("Adam"));

            command.Execute(environment);

            Assert.AreEqual("Adam", adam.FirstName);
        }
        public void SetAttributeInDynamicObject()
        {
            BindingEnvironment environment = new BindingEnvironment();
            DefinedClass klass = new DefinedClass("Spam");
            DynamicObject dynobj = new DynamicObject(klass);
            environment.SetValue("foo", dynobj);

            SetAttributeCommand command = new SetAttributeCommand(new NameExpression("foo"), "one", new ConstantExpression(1));

            command.Execute(environment);

            Assert.IsTrue(dynobj.HasValue("one"));
            Assert.AreEqual(1, dynobj.GetValue("one"));
        }
        public void SetAttributeInDynamicObject()
        {
            BindingEnvironment environment = new BindingEnvironment();
            DefinedClass       klass       = new DefinedClass("Spam");
            DynamicObject      dynobj      = new DynamicObject(klass);

            environment.SetValue("foo", dynobj);

            SetAttributeCommand command = new SetAttributeCommand(new NameExpression("foo"), "one", new ConstantExpression(1));

            command.Execute(environment);

            Assert.IsTrue(dynobj.HasValue("one"));
            Assert.AreEqual(1, dynobj.GetValue("one"));
        }