1 2 3 4 5 6 7 8 9 10 11 12 13
using System.Linq; using System.Reflection; namespace Timeline.Tests.Helpers { public static class ReflectionHelper { public static ParameterInfo GetParameter(this MethodInfo methodInfo, string name) { return methodInfo.GetParameters().Where(p => p.Name == name).Single(); } } }