TestGetCustomAttribute_Type2() public method

public TestGetCustomAttribute_Type2 ( MemberInfo mem ) : bool
mem System.Reflection.MemberInfo
return bool
 public bool RunTest()
   {
   print (strPath + strTest + "  RunTest() started.");
   string strLoc="L_000";
   MyClass myclass = new MyClass ();
   MyClass2 myclass2 = new MyClass2 ();
   MemberInfo mem = null;
   MemberInfo mem2 = null;
   Attribute[] attrs = null;
   Type type = null;
   Type type2 = null;
   try  
     {
     strLoc="L_200_001";
     iCountTestcases++;
     strLoc="L_200_002";
     type = myclass.GetType ();
     mem = type.GetMethod ("MyMethod");
     if (mem == null) {
     iCountErrors++;
     Util.printerr ("E_200_75yhg - mem == null");
     }
     iCountTestcases++;
     strLoc="L_200_002.1";
     try {
     attrs = Attribute.GetCustomAttributes (mem, null, true);
     iCountErrors++;
     Util.printerr ("E_200_oi32 - Should 've thrown ArgNullExc");
     }
     catch (ArgumentException ) {
     }
     iCountTestcases++;
     strLoc="L_200_002.1.2";
     try {
     attrs = Attribute.GetCustomAttributes ((MemberInfo) null, typeof (ClassLib_Attributes.CA_AMfalse_INfalse), true);
     iCountErrors++;
     Util.printerr ("E_200_oi322 - Should 've thrown ArgNullExc");
     }
     catch (ArgumentException ) {
     }
     iCountTestcases++;
     strLoc="L_200_002.5";
     type = myclass.GetType ();
     mem = type;
     myclass.TestGetCustomAttribute_Type (mem);
     iCountTestcases++;
     strLoc="L_200_002.5.2";
     myclass.TestGetCustomAttribute_Type2 (mem);
     iCountTestcases++;
     strLoc="L_200_003.4";
     mem = type.GetConstructor (Type.EmptyTypes);
     myclass.TestGetCustomAttribute_Type (mem);
     iCountTestcases++;
     strLoc="L_200_003.4.2";
     myclass.TestGetCustomAttribute_Type2 (mem);
     iCountTestcases++;
     strLoc="L_200_003.5";
     mem = type.GetMethod ("MyMethod");
     myclass.TestGetCustomAttribute_Type (mem);
     iCountTestcases++;
     strLoc="L_200_003.5.2";
     myclass.TestGetCustomAttribute_Type2 (mem);
     iCountTestcases++;
     strLoc="L_200_004.5";
     mem = type.GetField ("MyField");
     myclass.TestGetCustomAttribute_Type (mem);
     iCountTestcases++;
     strLoc="L_200_004.5.2";
     myclass.TestGetCustomAttribute_Type2 (mem);
     iCountTestcases++;
     strLoc="L_200_005.5";
     mem = type.GetProperty ("MyProp");
     myclass.TestGetCustomAttribute_Type (mem);
     iCountTestcases++;
     strLoc="L_200_005.5.2";
     myclass.TestGetCustomAttribute_Type2 (mem);
     iCountTestcases++;
     strLoc="L_200_005.6";
     mem = type.GetEvent ("MyEvent");
     myclass.TestGetCustomAttribute_Type (mem);
     iCountTestcases++;
     strLoc="L_200_005.6.2";
     myclass.TestGetCustomAttribute_Type2 (mem);
     iCountTestcases++;
     strLoc="L_2_200_002.5";
     type2 = myclass2.GetType ();
     mem2 = type2;
     myclass2.TestGetCustomAttribute_Type (mem2);
     iCountTestcases++;
     strLoc="L_2_200_002.5.2";
     myclass2.TestGetCustomAttribute_Type2 (mem2);
     iCountTestcases++;
     strLoc="L_2_200_003.4";
     mem2 = type2.GetConstructor (Type.EmptyTypes);
     myclass2.TestGetCustomAttribute_Type (mem2);
     iCountTestcases++;
     strLoc="L_2_200_003.4.2";
     myclass2.TestGetCustomAttribute_Type2 (mem2);
     iCountTestcases++;
     strLoc="L_2_200_003.5";
     mem2 = type2.GetMethod ("MyMethod");
     myclass2.TestGetCustomAttribute_Type (mem2);
     iCountTestcases++;
     strLoc="L_2_200_003.5.2";
     myclass2.TestGetCustomAttribute_Type2 (mem2);
     iCountTestcases++;
     strLoc="L_2_200_004.5";
     mem2 = type2.GetField ("MyField");
     myclass2.TestGetCustomAttribute_Type (mem2);
     iCountTestcases++;
     strLoc="L_2_200_004.5.2";
     myclass2.TestGetCustomAttribute_Type2 (mem2);
     iCountTestcases++;
     strLoc="L_2_200_005.5";
     mem2 = type2.GetProperty ("MyProp");
     myclass2.TestGetCustomAttribute_Type (mem2);
     iCountTestcases++;
     strLoc="L_2_200_005.5.2";
     myclass2.TestGetCustomAttribute_Type2 (mem2);
     iCountTestcases++;
     strLoc="L_2_200_005.6";
     mem2 = type2.GetEvent ("MyEvent");
     myclass2.TestGetCustomAttribute_Type (mem2);
     iCountTestcases++;
     strLoc="L_2_200_005.6.2";
     myclass2.TestGetCustomAttribute_Type2 (mem2);
     }
   catch( Exception exc_runTest ) {
   ++myclass2.iCountErrors;
   printerr ("Err_888un! - Uncaught Exception caught in runTest(); strLoc == " + strLoc);
   printexc (exc_runTest);
   print (exc_runTest.StackTrace);
   }
   iCountErrors = myclass.iCountErrors + myclass2.iCountErrors;
   iCountTestcases = myclass.iCountTestcases + myclass2.iCountTestcases;
   if ( iCountErrors == 0 ) {   return true; }
   else {
   print  ("Related Bugs: " + strBug);
   print ("FAiL!   " + strPath +strTest + "  iCountErrors==" +  iCountErrors.ToString ());
   print ("iCountTestcases==" +  iCountTestcases.ToString ());
   return false;
   }
   }