Equals() public method

public Equals ( Object obj ) : bool
obj Object
return bool
        override public bool TestGetCustomAttribute_Type(ParameterInfo param)
        {
            Util.print("\n\n" + this.GetType().ToString() + " - TestGetCustomAttribute_Type() started.");
            Util.print("For ParamInfo on: " + param.Member.GetType().ToString() + "\n");
            string    strLoc = "L_2_000";
            Attribute attr   = null;

            try
            {
                do
                {
                    iCountTestcases++;
                    strLoc = "L_2_001";
                    iCountTestcases++;
                    strLoc = "L_2_002.2";
                    attr   = Attribute.GetCustomAttribute(param, typeof(ClassLib_Attributes.CA_AMfalse_INfalse), true);
                    if (attr == null)
                    {
                        iCountErrors++;
                        Util.printerr("E_2_gfh4 - attr == null");
                    }
                    iCountTestcases++;
                    strLoc = "L_2_001.4";
                    if (attr is ClassLib_Attributes.CA_AMfalse_INfalse)
                    {
                        if (((ClassLib_Attributes.CA_AMfalse_INfalse)attr).name.Equals("CA_AMfalse_INfalse2"))
                        {
                            iCountTestcases++;
                            strLoc = "L_2_001.5";
                            if (!caAmfInf2.Equals(attr))
                            {
                                iCountErrors++;
                                Util.printerr("E_2_8d2p- caAmfInf2.Equals FAiLed!");
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        iCountErrors++;
                        Util.printerr("E_2_9dus- UnExpected attr type! - " + attr.GetType().ToString());
                    }
                    iCountTestcases++;
                    strLoc = "L_3_002.2";
                    attr   = Attribute.GetCustomAttribute(param, typeof(ClassLib_Attributes.CA_AMfalse_INtrue), true);
                    if (attr == null)
                    {
                        iCountErrors++;
                        Util.printerr("E_3_gfh4 - attr == null");
                    }
                    iCountTestcases++;
                    strLoc = "L_3_001.4";
                    if (attr is ClassLib_Attributes.CA_AMfalse_INtrue)
                    {
                        if (((ClassLib_Attributes.CA_AMfalse_INtrue)attr).name.Equals("CA_AMfalse_INtrue2"))
                        {
                            iCountTestcases++;
                            strLoc = "L_3_001.5";
                            if (!caAmfInt2.Equals(attr))
                            {
                                iCountErrors++;
                                Util.printerr("E_3_8d2p- caAmfInt2.Equals FAiLed!");
                            }
                        }
                        else
                        {
                            iCountErrors++;
                            Util.printerr("E_3_iu2h- UnExpected attr.name! - " + ((ClassLib_Attributes.CA_AMfalse_INtrue)attr).name);
                        }
                    }
                    else
                    {
                        iCountErrors++;
                        Util.printerr("E_3_9dus- UnExpected attr type! - " + attr.GetType().ToString());
                    }
                    iCountTestcases++;
                    strLoc = "L_4_002.2";
                    try {
                        attr = Attribute.GetCustomAttribute(param, typeof(ClassLib_Attributes.CA_AMtrue_INtrue), true);
                        if (!((param.Member is FieldInfo) || (param.Member is ConstructorInfo)))
                        {
                            iCountErrors++;
                            Util.printerr("E_4_5_jhd3 - should 've thrown AmbiguousMatchException");
                        }
                    }
                    catch (AmbiguousMatchException) {
                    }
                    iCountTestcases++;
                    strLoc = "L_5_002.2";
                    attr   = Attribute.GetCustomAttribute(param, typeof(ClassLib_Attributes.CA_AMtrue_INfalse), true);
                    if (attr == null)
                    {
                        iCountErrors++;
                        Util.printerr("E_5_gfh4 - attr == null");
                    }
                    iCountTestcases++;
                    strLoc = "L_5_001.4";
                    if (attr is ClassLib_Attributes.CA_AMtrue_INfalse)
                    {
                        if (((ClassLib_Attributes.CA_AMtrue_INfalse)attr).name.Equals("CA_AMtrue_INfalse3"))
                        {
                            iCountTestcases++;
                            strLoc = "L_5_001.5";
                            if (!caAmtInf3.Equals(attr))
                            {
                                iCountErrors++;
                                Util.printerr("E_5_8d2p5- caAmtInf3.Equals FAiLed!");
                            }
                        }
                        else
                        {
                            iCountErrors++;
                            Util.printerr("E_5_djfh - UnExpected attr name! - " + ((ClassLib_Attributes.CA_AMtrue_INfalse)attr).name);
                        }
                    }
                    else
                    {
                        iCountErrors++;
                        Util.printerr("E_5_9dus- UnExpected attr type! - " + attr.GetType().ToString());
                    }
                    iCountTestcases++;
                    strLoc = "L_6_002.2";
                    try {
                        attr = Attribute.GetCustomAttribute(param, typeof(System.Attribute), true);
                        iCountErrors++;
                        Util.printerr("E_6_5_jhd3 - should 've thrown AmbiguousMatchException");
                    }
                    catch (AmbiguousMatchException) {
                    }
                } while (false);
            }
            catch (Exception exc_runTest) {
                ++iCountErrors;
                Util.printerr("Err_333un! - Uncaught Exception caught in TestGetCustomAttribute_Type(); strLoc == " + strLoc);
                Util.printexc(exc_runTest);
                Util.print(exc_runTest.StackTrace);
            }
            if (iCountErrors == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        override public bool TestAttributes(Attribute[] attrs, MemberInfo mem)
        {
            string strLoc = "L_000";
            String str    = null;

            try
            {
                do
                {
                    if (Util.DEBUG > 0)
                    {
                        Console.WriteLine("Number of attrs {0}", attrs.Length);
                    }
                    for (int i = 0; i < attrs.Length; i++)
                    {
                        iCountTestcases++;
                        strLoc = "L_001.3.2";
                        str    = attrs[i].ToString();
                        if (Util.DEBUG > 1)
                        {
                            Console.WriteLine("{0} : {1}\n\n", i, str);
                        }
                        iCountTestcases++;
                        strLoc = "L_001.4";
                        if (attrs[i] is ClassLib_Attributes.CA_AMfalse_INfalse)
                        {
                            ClassLib_Attributes.CA_AMfalse_INfalse attr = (ClassLib_Attributes.CA_AMfalse_INfalse)attrs[i];
                            if (attr.name.Equals("CA_AMfalse_INfalse2"))
                            {
                                iCountTestcases++;
                                strLoc = "L_001.5";
                                if (!caAmfInf2.Equals(attr))
                                {
                                    iCountErrors++;
                                    Util.printerr("E_8d2p- caAmfInf2.Equals FAiLed!");
                                }
                            }
                            else
                            {
                                iCountErrors++;
                                Util.printerr("E_iu2h- UnExpected attr.name! - " + attr.name);
                            }
                        }
                        else if (attrs[i] is ClassLib_Attributes.CA_AMfalse_INtrue)
                        {
                            ClassLib_Attributes.CA_AMfalse_INtrue attr = (ClassLib_Attributes.CA_AMfalse_INtrue)attrs[i];
                            if (attr.name.Equals("CA_AMfalse_INtrue2"))
                            {
                                iCountTestcases++;
                                strLoc = "L_11_001.5";
                                if (!caAmfInt2.Equals(attr))
                                {
                                    iCountErrors++;
                                    Util.printerr("E_11_8d2p- caAmfInt2.Equals FAiLed!");
                                }
                            }
                            else
                            {
                                iCountErrors++;
                                Util.printerr("E_11_iu2h- UnExpected attr.name! - " + attr.name);
                            }
                        }
                        else if (attrs[i] is ClassLib_Attributes.CA_AMtrue_INtrue)
                        {
                            ClassLib_Attributes.CA_AMtrue_INtrue attr = (ClassLib_Attributes.CA_AMtrue_INtrue)attrs[i];
                            if (!(mem is System.Reflection.ConstructorInfo))
                            {
                                if (attr.name.Equals("CA_AMtrue_INtrue"))
                                {
                                    iCountTestcases++;
                                    strLoc = "L_12_001.5";
                                    if (!caAmtInt.Equals(attr))
                                    {
                                        iCountErrors++;
                                        Util.printerr("E_12_8d2p5- caAmtInt.Equals FAiLed!");
                                    }
                                }
                                else if (attr.name.Equals("CA_AMtrue_INtrue2"))
                                {
                                    iCountTestcases++;
                                    strLoc = "L_12_001.6";
                                    if (!caAmtInt2.Equals(attr))
                                    {
                                        iCountErrors++;
                                        Util.printerr("E_12_8d2p6- caAmtInt2.Equals FAiLed!");
                                    }
                                }
                                else if (attr.name.Equals("CA_AMtrue_INtrue3"))
                                {
                                    iCountTestcases++;
                                    strLoc = "L_12_001.6.2";
                                    if (!caAmtInt3.Equals(attr))
                                    {
                                        iCountErrors++;
                                        Util.printerr("E_12_dj2o - caAmtInt3.Equals FAiLed!");
                                    }
                                }
                                else
                                {
                                    iCountErrors++;
                                    Util.printerr("E_12_8dh2 - UnExpected attr.name! - " + attr.name);
                                }
                            }
                            else if (attr.name.Equals("CA_AMtrue_INtrue3"))
                            {
                                iCountTestcases++;
                                strLoc = "L_12_001.7";
                                if (!caAmtInt3.Equals(attr))
                                {
                                    iCountErrors++;
                                    Util.printerr("E_12_8d2p7- caAmtInt3.Equals FAiLed!");
                                }
                            }
                            else
                            {
                                iCountErrors++;
                                Util.printerr("E_12_iu2h- UnExpected attr.name! - " + attr.name);
                            }
                        }
                        else if (attrs[i] is ClassLib_Attributes.CA_AMtrue_INfalse)
                        {
                            ClassLib_Attributes.CA_AMtrue_INfalse attr = (ClassLib_Attributes.CA_AMtrue_INfalse)attrs[i];
                            if (attr.name.Equals("CA_AMtrue_INfalse3"))
                            {
                                iCountTestcases++;
                                strLoc = "L_13_001.5";
                                if (!caAmtInf3.Equals(attr))
                                {
                                    iCountErrors++;
                                    Util.printerr("E_13_8d2p- caAmtInf3.Equals FAiLed!");
                                }
                            }
                            else
                            {
                                iCountErrors++;
                                Util.printerr("E_13_iu2h- UnExpected attr.name! - " + attr.name);
                            }
                        }
                        else
                        {
                            iCountErrors++;
                            Util.printerr("E_iu2h- UnExpected attr type! - " + attrs[i].GetType().ToString());
                        }
                    }
                } while (false);
            }
            catch (Exception exc_runTest) {
                ++iCountErrors;
                Util.printerr("Err_482un! - Uncaught Exception caught in TestAttributes(); strLoc == " + strLoc);
                Util.printexc(exc_runTest);
                Util.print(exc_runTest.StackTrace);
            }
            if (iCountErrors == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }