Explorar o código

2004-09-25 Zoltan Varga <[email protected]>

	* ParameterInfoTest.cs: New file.

svn path=/trunk/mcs/; revision=34393
Zoltan Varga %!s(int64=21) %!d(string=hai) anos
pai
achega
7db58113f5

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

@@ -1,3 +1,7 @@
+2004-09-25  Zoltan Varga  <[email protected]>
+
+	* ParameterInfoTest.cs: New file.
+
 2004-09-22  Zoltan Varga  <[email protected]>
 
 	* ModuleTest.cs: Add tests for NET 2.0 ResolveXXX methods.

+ 39 - 0
mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs

@@ -0,0 +1,39 @@
+//
+// ParameterInfoTest - NUnit Test Cases for the ParameterInfo class
+//
+// Zoltan Varga ([email protected])
+//
+// (C) Ximian, Inc.  http://www.ximian.com
+//
+//
+
+using System;
+using System.Threading;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Runtime.InteropServices;
+
+using NUnit.Framework;
+
+namespace MonoTests.System.Reflection
+{
+
+[TestFixture]
+public class ParameterInfoTest : Assertion
+{
+	public static void paramMethod (int i, [In] int j, [Out] int k, [Optional] int l, [In,Out] int m) {
+	}
+
+#if NET_2_0
+	[Test]
+	public void PseudoCustomAttributes () {
+		ParameterInfo[] info = typeof (ParameterInfoTest).GetMethod ("paramMethod").GetParameters ();
+		AssertEquals (0, info[0].GetCustomAttributes (true).Length);
+		AssertEquals (1, info[1].GetCustomAttributes (typeof (InAttribute), true).Length);
+		AssertEquals (1, info[2].GetCustomAttributes (typeof (OutAttribute), true).Length);
+		AssertEquals (1, info[3].GetCustomAttributes (typeof (OptionalAttribute), true).Length);
+		AssertEquals (2, info[4].GetCustomAttributes (true).Length);
+	}
+#endif
+}		
+}