<PackageReference Include="NUnit" Version="3.7.1" />

ParameterWrapper

The ParameterWrapper class wraps a ParameterInfo so that it may be used in a platform-independent manner.
using NUnit.Framework.Interfaces; using System; using System.Reflection; namespace NUnit.Framework.Internal { public class ParameterWrapper : IParameterInfo, IReflectionInfo { public bool IsOptional => ParameterInfo.IsOptional; public IMethodInfo Method { get; set; } public ParameterInfo ParameterInfo { get; set; } public Type ParameterType => ParameterInfo.ParameterType; public ParameterWrapper(IMethodInfo method, ParameterInfo parameterInfo) { Method = method; ParameterInfo = parameterInfo; } public T[] GetCustomAttributes<T>(bool inherit) where T : class { return (T[])ParameterInfo.GetCustomAttributes(typeof(T), inherit); } public bool IsDefined<T>(bool inherit) { return ParameterInfo.IsDefined(typeof(T), inherit); } } }