Ejemplo n.º 1
0
 public void Test_PropertyNameBinding_MissingProperty()
 {
     Assert.ThrowsException <NullReferenceException>(() => {
         PropertyNameDataPointBinding binding = new PropertyNameDataPointBinding();
         binding.PropertyName = "Wrong";
         binding.GetValue(new BusinessObject());
     });
 }
Ejemplo n.º 2
0
        public void Test_PropertyNameBinding_DynamicObject()
        {
            PropertyNameDataPointBinding binding = new PropertyNameDataPointBinding();

            binding.PropertyName = "Value";

            dynamic obj = new MyDynamicObject();

            obj.Value = 1;

            Assert.AreEqual <double>(1, (double)binding.GetValue(obj), "DynamicObject Value not looked-up correctly");
        }
Ejemplo n.º 3
0
        public void Test_PropertyNameBinding()
        {
            PropertyNameDataPointBinding binding = new PropertyNameDataPointBinding();

            binding.PropertyName = "Value";

            BusinessObject obj = new BusinessObject()
            {
                Value = 1
            };

            Assert.AreEqual <double>(1, (double)binding.GetValue(obj), "Value not looked-up correctly");
        }