コード例 #1
0
 public void CountTheNumberOfFunction()
 {
     ReflectMe instance = new ReflectMe();
     Type instanceType = instance.GetType();
     var methods = instanceType.GetMethods();
     Assert.AreEqual(instanceType.GetMethods().Length, 6);
 }
コード例 #2
0
 public void FindDO()
 {
     ReflectMe instance = new ReflectMe();
     Type instanceType = instance.GetType();
     var methods = instanceType.GetMethods();
     foreach(var method in methods)
     {
         if(method.Name == "Do")
         {
             method.GetCustomAttributes(true);
         }
     }
     Assert.Fail("Method Do Wasnet found");
 }