Browse Source

* PropertyInfoTest.cs: New file. Added test for
bug #58661.

svn path=/trunk/mcs/; revision=27602

Gert Driesen 21 years ago
parent
commit
af7d2eaa1d

+ 5 - 0
mcs/class/corlib/Test/System.Reflection/ChangeLog

@@ -1,3 +1,8 @@
+2004-05-18  Gert Driesen ([email protected])
+
+	* PropertyInfoTest.cs: New file.  Added test for 
+	bug #58661.
+
 2004-05-13  Gonzalo Paniagua Javier <[email protected]>
 
 	* BinderTests.cs: New file.

+ 41 - 0
mcs/class/corlib/Test/System.Reflection/PropertyInfoTest.cs

@@ -0,0 +1,41 @@
+//
+// PropertyInfoTest.cs - NUnit Test Cases for PropertyInfo
+//
+// Author:
+//	Gert Driesen ([email protected])
+//
+// (C) 2004 Novell 
+//
+
+using System;
+using System.Reflection; 
+
+using NUnit.Framework;
+
+namespace MonoTests.System.Reflection
+{
+	[TestFixture]
+	public class PropertyInfoTest : Assertion 
+	{
+		[Test]
+		public void GetAccessorsTest()
+		{
+			Type type = typeof(TestClass);
+			PropertyInfo property = type.GetProperty ("ReadOnlyProperty");
+        		MethodInfo[] methods = property.GetAccessors (true);
+
+			AssertEquals ("GetAccessors#1", 1, methods.Length);
+			AssertNotNull ("GetAccessors#2", methods[0]);
+						
+		}
+
+
+		private class TestClass 
+		{
+			public string ReadOnlyProperty 
+			{
+				get { return string.Empty; }
+			}
+		}
+	}
+}