示例#1
0
        public void SetPropertyValueNestedNull()
        {
            Tester tester = new Tester();

            LateBinder.SetProperty(tester, "Order.OrderAddress.City", "New Description");

            Assert.AreEqual("New Description", tester.Order.OrderAddress.City);
        }
示例#2
0
        public void SetPropertyValueBoxed()
        {
            Tester tester = new Tester();

            LateBinder.SetProperty(tester, "Id", 999);

            Assert.AreEqual(999, tester.Id);
        }
示例#3
0
        public void SetPropertyValue()
        {
            Tester tester = new Tester();

            LateBinder.SetProperty(tester, "Name", "New Name");

            Assert.AreEqual("New Name", tester.Name);
        }
示例#4
0
        public void SetPropertyValueNested()
        {
            Tester tester = new Tester();

            tester.Order = new Order();

            LateBinder.SetProperty(tester, "Order.Description", "New Description");

            Assert.AreEqual("New Description", tester.Order.Description);
        }
示例#5
0
        public void SetPropertyValueNestedObject()
        {
            Tester tester = new Tester();

            tester.Order = new Order();

            LateBinder.SetProperty(tester, "Order.OrderAddress", new OrderAddress {
                Zip = "55346"
            });

            Assert.AreEqual("55346", tester.Order.OrderAddress.Zip);
        }