* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System / Test / System.ComponentModel / TypeDescriptorTests.cs
index 3a8766a19a75227c41dc8a197830e23eb310c898..e73232300839d912243bd434ad245f72cd830387 100644 (file)
@@ -322,6 +322,11 @@ namespace MonoTests.System.ComponentModel
                        AssertEquals (typeof(TypeConverter), TypeDescriptor.GetConverter (new TestClass ()).GetType());
                        AssertEquals (typeof(TypeConverter), TypeDescriptor.GetConverter (new TestStruct ()).GetType());
                        AssertEquals (typeof(CollectionConverter), TypeDescriptor.GetConverter (new Hashtable ()).GetType());
+
+#if NET_2_0
+                       // Test from bug #76686
+                       AssertEquals (typeof (Int32Converter), TypeDescriptor.GetConverter ((int?) 1).GetType ());
+#endif
                }
                
                [Test]
@@ -497,6 +502,21 @@ namespace MonoTests.System.ComponentModel
                        TestConverter converter = (TestConverter) t;
                        AssertEquals ("#03", typeof (TestConverterClass), converter.Type);
                }
+
+               [Test]
+               public void GetPropertiesIgnoreIndexers ()
+               {
+                       PropertyDescriptorCollection pc =
+                               TypeDescriptor.GetProperties (typeof (string));
+                       // There are two string properties: Length and Chars.
+                       // Chars is an indexer.
+                       //
+                       // Future version of CLI might contain some additional
+                       // properties. In that case simply increase the
+                       // number. (Also, it is fine to just remove #2.)
+                       AssertEquals ("#1", 1, pc.Count);
+                       AssertEquals ("#2", "Length", pc [0].Name);
+               }
        }
 }