예제 #1
0
 public void GetMethodInvalidGenericsTest()
 {
     Assert.Throws <ArgumentException>(() => KUtility.GetMethod(typeof(UtilityTests),
                                                                BindingFlags.Instance | BindingFlags.Public,
                                                                nameof(GetMethodTest),
                                                                new[] { typeof(KUtility) },
                                                                Array.Empty <object>()));
 }
예제 #2
0
 public void GetMethodInvalidParamsTest()
 {
     Assert.Throws <ArgumentException>(() => KUtility.GetMethod(typeof(UtilityTests),
                                                                BindingFlags.Instance | BindingFlags.Public,
                                                                nameof(GetMethodTest),
                                                                Array.Empty <Type>(),
                                                                new object[] { this }));
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }