You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OutputHelper.WriteLine("Checking parameters for 2nd constructor of ClassWith3Constructors");
495
+
Assert.Equal(constructorParameters[0].ParameterType.ToString(),$"{typeof(int)}",$"Expecting parameter of type {typeof(int)}, got {constructorParameters[0].ParameterType}.");
OutputHelper.WriteLine("Checking parameters for 3rd constructor of ClassWith3Constructors");
503
+
Assert.Equal(constructorParameters[0].ParameterType.ToString(),$"{typeof(int)}",$"Expecting parameter of type {typeof(int)}, got {constructorParameters[0].ParameterType}.");
504
+
Assert.Equal(constructorParameters[1].ParameterType.ToString(),$"{typeof(string)}",$"Expecting parameter of type {typeof(string)}, got {constructorParameters[0].ParameterType}.");
505
+
}
506
+
365
507
//Constructors Test Classes
366
508
classConstructorsTestClass1
367
509
{
@@ -1180,6 +1322,22 @@ public static bool testMethod()
1180
1322
}
1181
1323
}
1182
1324
1325
+
classConstructorsTestClass36
1326
+
{
1327
+
1328
+
// static constructor
1329
+
staticConstructorsTestClass36()
1330
+
{
1331
+
intI=5;
1332
+
}
1333
+
1334
+
staticintintI=1;
1335
+
1336
+
publicstaticbooltestMethod()
1337
+
{
1338
+
return(intI==5);
1339
+
}
1340
+
}
1183
1341
1184
1342
classConstructorsTestClass44_Base
1185
1343
{
@@ -1567,5 +1725,21 @@ public static bool testMethod()
Copy file name to clipboardExpand all lines: nanoFramework.CoreLibrary/System/Reflection/MethodBase.cs
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,9 @@ namespace System.Reflection
18
18
[Serializable]
19
19
publicabstractclassMethodBase:MemberInfo
20
20
{
21
+
// required to store native
22
+
privateint_token;
23
+
21
24
/// <summary>
22
25
/// Gets a value indicating whether this is a public method.
23
26
/// </summary>
@@ -78,6 +81,12 @@ public extern bool IsAbstract
78
81
get;
79
82
}
80
83
84
+
/// <summary>
85
+
/// When overridden in a derived class, gets the parameters of the specified method or constructor.
86
+
/// </summary>
87
+
/// <returns>An array of type <see cref="ParameterInfo"/> containing information that matches the signature of the method (or constructor) reflected by this <see cref="MethodBase"/> instance.</returns>
88
+
publicabstractParameterInfo[]GetParameters();
89
+
81
90
/// <summary>
82
91
/// Invokes the method or constructor represented by the current instance, using the specified parameters.
83
92
/// </summary>
@@ -114,6 +123,9 @@ public override extern Type DeclaringType
/// Returns all the public constructors defined for the current <see cref="Type"/>.
153
+
/// </summary>
154
+
/// <returns>
155
+
/// An array of <see cref="ConstructorInfo"/> objects representing all the public instance constructors defined for the current <see cref="Type"/>, but not including the type initializer (static constructor). If no public instance constructors are defined for the current <see cref="Type"/>, or if the current <see cref="Type"/> represents a type parameter in the definition of a generic type or generic method, an empty array of type <see cref="ConstructorInfo"/> is returned.
156
+
/// </returns>
157
+
[MethodImpl(MethodImplOptions.InternalCall)]
158
+
publicexternConstructorInfo[]GetConstructors();
159
+
151
160
/// <summary>
152
161
/// Searches for the specified public method whose parameters match the specified argument types.
0 commit comments