예제 #1
0
 public void Set_Value_Sets_Underlying_Value()
 {
     var adapter = new PropertyInfoAdapter(_testProperty);
     var guid = Guid.NewGuid().ToString("N");
     adapter.SetValue(_tester, guid, null);
     Assert.AreEqual(guid, adapter.GetValue(_tester, null));
 }
예제 #2
0
 public void Property_Type_Returns_Underlying_Property_Type()
 {
     var adapter = new PropertyInfoAdapter(_testProperty);
     Assert.AreEqual(typeof(string), adapter.PropertyType);
 }
예제 #3
0
 public void Get_Value_Returns_Underlying_Value()
 {
     var adapter = new PropertyInfoAdapter(_testProperty);
     Assert.AreEqual("Test", adapter.GetValue(_tester, null));
 }
예제 #4
0
 public void Name_Returns_Underlying_Name()
 {
     var adapter = new PropertyInfoAdapter(_testProperty);
     Assert.AreEqual("TestProperty", adapter.Name);
 }
예제 #5
0
 public void Get_Custom_Attributes_Returns_Underlying_Attributes()
 {
     var adapter = new PropertyInfoAdapter(_testPropertyWithAttribute);
     var attributes = adapter.GetCustomAttributes(typeof (System.ComponentModel.DescriptionAttribute), false);
     Assert.AreEqual(1, attributes.Length);
 }