Merge pull request #1624 from esdrubal/getprocesstimes
[mono.git] / mcs / class / corlib / Test / System.Reflection / ParameterInfoTest.cs
index 90362747a6c39b92aa2e5faa57d5bc96fb1aa9b8..423c7c0670d9d915f1a031208f0cc87b21740af1 100644 (file)
@@ -14,6 +14,7 @@ using System.Reflection;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;
 using System.Collections.Generic;
+using System.Linq;
 
 using NUnit.Framework;
 
@@ -260,6 +261,26 @@ namespace MonoTests.System.Reflection
                }
 #endif
 
+               class TestAttribute : Attribute
+               {
+               }
+
+               public static int TestCustomAttribute_Method ([Test] string arg)
+               {
+                       return arg.Length;
+               }
+
+               [Test]
+               public void TestCustomAttribute ()
+               {
+                       var metInfo = GetType ().GetMethod ("TestCustomAttribute_Method", new Type[] { typeof(string) });
+                       var paramInfos = metInfo.GetParameters ();
+                       var argParamInfo = paramInfos[0];
+
+                       var custAttrs = argParamInfo.GetCustomAttributes ();
+                       Assert.AreEqual (1, custAttrs.Count ());
+               }
+
                class MyParameterInfo2 : ParameterInfo
                {
                        public ParameterAttributes MyAttrsImpl;
@@ -332,7 +353,9 @@ namespace MonoTests.System.Reflection
                        }
 #endif
                        Assert.IsFalse (p.IsIn, "#7");
+#if FEATURE_USE_LCID
                        Assert.IsFalse (p.IsLcid, "#8");
+#endif
                        Assert.IsFalse (p.IsOptional, "#9");
                        Assert.IsFalse (p.IsOut, "#10");
                        Assert.IsFalse (p.IsRetval, "#10");