public void GetMethodInvalidGenericsTest() { Assert.Throws <ArgumentException>(() => KUtility.GetMethod(typeof(UtilityTests), BindingFlags.Instance | BindingFlags.Public, nameof(GetMethodTest), new[] { typeof(KUtility) }, Array.Empty <object>())); }
public void GetMethodInvalidParamsTest() { Assert.Throws <ArgumentException>(() => KUtility.GetMethod(typeof(UtilityTests), BindingFlags.Instance | BindingFlags.Public, nameof(GetMethodTest), Array.Empty <Type>(), new object[] { this })); }
public void GetMethodTest2() { MethodInfo method = KUtility.GetMethod(typeof(Merger), BindingFlags.Static | BindingFlags.Public, nameof(Merger.MergeLists), new[] { typeof(string) }, new object[] { "string", "string2", null }); Assert.Equal(nameof(Merger.MergeLists), method.Name); }
public void GetMethodTest() { MethodInfo method = KUtility.GetMethod(typeof(UtilityTests), BindingFlags.Instance | BindingFlags.Public, nameof(GetMethodTest), Array.Empty <Type>(), Array.Empty <object>()); Assert.Equal(MethodBase.GetCurrentMethod(), method); }