override public bool TestIsDefined_Type (MemberInfo mem)
{
Util.print ("\n\n" + this.GetType ().ToString () + " - TestIsDefined_Type() started.");
Util.print ("For: " + mem.GetType ().ToString () + "\n");
string strLoc="L_2_000";
bool isattr = false;
try
{
do
{
iCountTestcases++;
strLoc="L_2_001";
iCountTestcases++;
strLoc="L_2_002.2";
isattr = Attribute.IsDefined (mem, typeof (ClassLib_Attributes.CA_AMfalse_INfalse), false);
if (isattr) {
iCountErrors++;
Util.printerr ("E_2_gfh4 - IsDefined returned true");
}
iCountTestcases++;
strLoc="L_3_002.2";
isattr = Attribute.IsDefined (mem, typeof (ClassLib_Attributes.CA_AMfalse_INtrue), true);
if ((mem is ConstructorInfo) || (mem is FieldInfo) ) {
if (isattr) {
iCountErrors++;
Util.printerr ("E_3_fkj2 - IsDefined returned true");
}
}
else if (!isattr) {
iCountErrors++;
Util.printerr ("E_3_gfh4 - IsDefined returned false");
}
iCountTestcases++;
strLoc="L_4_002.2";
isattr = Attribute.IsDefined (mem, typeof (ClassLib_Attributes.CA_AMtrue_INtrue), true);
if ((mem is ConstructorInfo) || (mem is FieldInfo)) {
if (isattr) {
iCountErrors++;
Util.printerr ("E_4_fkj2 - IsDefined returned true");
}
}
else if (!isattr) {
iCountErrors++;
Util.printerr ("E_4_gfh4 - IsDefined returned false");
}
iCountTestcases++;
strLoc="L_5_002.2";
isattr = Attribute.IsDefined (mem, typeof (ClassLib_Attributes.CA_AMtrue_INfalse), false);
if (!isattr) {
iCountErrors++;
Util.printerr ("E_5_gfh4 - IsDefined returned false");
}
iCountTestcases++;
strLoc="L_6_002.2";
isattr = Attribute.IsDefined (mem, typeof (System.Attribute), true);
if (!isattr) {
iCountErrors++;
Util.printerr ("E_6_gfh4 - IsDefined returned false");
}
} while ( false );
}
catch( Exception exc_runTest ) {
++iCountErrors;
Util.printerr ("Err_333un! - Uncaught Exception caught in TestIsDefined_Type(); strLoc == " + strLoc);
Util.printexc (exc_runTest);
Util.print (exc_runTest.StackTrace);
}
if ( iCountErrors == 0 ) { return true; }
else { return false;}
}
}