Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / corlib / Test / System.Reflection / PropertyInfoTest.cs
index 4dfa2b2dba703ca995f4790f3e68d6f94917b922..f461e8be636edf1285b2cf22e5f17ac6b6fb5e60 100644 (file)
@@ -402,7 +402,7 @@ namespace MonoTests.System.Reflection
                        }
                }
 #endif
-#if NET_2_0
+
                public class A<T>
                {
                        public string Property {
@@ -418,7 +418,6 @@ namespace MonoTests.System.Reflection
                }
 
                [Test]
-               [Category ("MobileNotWorking")] // bug #10266 
                public void NullableTests ()
                {
                        PropertyInfoTest t = new PropertyInfoTest ();
@@ -439,8 +438,13 @@ namespace MonoTests.System.Reflection
                        PropertyInfo property = type.GetProperty ("Property");
                        Assert.AreEqual (typeof (string).FullName, property.GetValue (instance, null));
                }
-#endif
 
+               [Test]
+               public void ToStringTest ()
+               {
+                       var pa = typeof (TestC).GetProperty ("Item");
+                       Assert.AreEqual ("Int32 Item [Double[]]", pa.ToString ());
+               }
 
                static bool HasAttribute (object [] attrs, Type attributeType)
                {
@@ -524,5 +528,23 @@ namespace MonoTests.System.Reflection
                                Assert.IsTrue (ex.InnerException is ObjectDisposedException);
                        }
                }
+
+               public class DefaultValueTest
+               {
+                       public string this[int val, string param = "test"]
+                       {
+                               get{ return val + param; }
+                       }
+               }
+
+
+               [Test]
+               public void PropertyWithDefaultValue ()
+               {
+                       var parameters = typeof (DefaultValueTest).GetProperty ("Item").GetIndexParameters ();
+                       var defaultParam = parameters[parameters.Length - 1];
+                       Assert.AreEqual ("param", defaultParam.Name, "#1");
+                       Assert.AreEqual ("test", defaultParam.DefaultValue, "#2");
+               }
        }
 }