コード例 #1
0
        private void OnEnable()
        {
            MemberInfo pMemberInfo = null;

            #region Initialize
            MemberInfo[] arrMembers = GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
            for (int i = 0; i < arrMembers.Length; i++)
            {
                if (arrMembers[i].Name.Equals(nameof(GetComponent_Attribute)))
                {
                    pMemberInfo = arrMembers[i];
                    break;
                }
            }

            GameObject pObjectChild = new GameObject("Child");
            pObjectChild.transform.parent = transform;
            #endregion Initialize


            string strTestCase = ETestCase.GetComponent_DefulatProperty.ToString();
            for (int i = 0; i < iTestCase; i++)
            {
                SCManagerProfiler.DoStartTestCase(strTestCase);
                GetComponent_Property = null;
                GetComponent_Property = transform;
                GetComponent_Property.GetType();
                SCManagerProfiler.DoFinishTestCase(strTestCase);
            }

            strTestCase = ETestCase.GetComponet_Function.ToString();
            for (int i = 0; i < iTestCase; i++)
            {
                SCManagerProfiler.DoStartTestCase(strTestCase);
                GetComponent_Function = null;
                GetComponent_Function = GetComponent <Transform>();
                GetComponent_Function.GetType();
                SCManagerProfiler.DoFinishTestCase(strTestCase);
            }

            strTestCase = ETestCase.GetComponetsInChildren_Function.ToString();
            for (int i = 0; i < iTestCase; i++)
            {
                SCManagerProfiler.DoStartTestCase(strTestCase);
                GetComponentsChildren_Children_Function = null;
                GetComponentsChildren_Children_Function = GetComponentsInChildren <Transform>();
                GetComponentsChildren_Children_Function[0].GetType();
                SCManagerProfiler.DoFinishTestCase(strTestCase);
            }

            strTestCase = ETestCase.GetComponet_Attribute_Individual.ToString();
            for (int i = 0; i < iTestCase; i++)
            {
                SCManagerProfiler.DoStartTestCase(strTestCase);
                GetComponent_Attribute = null;
                SCManagerGetComponent.DoUpdateGetComponentAttribute(this, this, pMemberInfo);
                GetComponent_Attribute.GetType();
                SCManagerProfiler.DoFinishTestCase(strTestCase);
            }

            strTestCase = ETestCase.GetComponet_Attribute_All.ToString();
            for (int i = 0; i < iTestCase; i++)
            {
                SCManagerProfiler.DoStartTestCase(strTestCase);
                GetComponentsChildren_Children_Attribute = null;
                SCManagerGetComponent.DoUpdateGetComponentAttribute(this);
                GetComponentsChildren_Children_Attribute[0].GetType();
                SCManagerProfiler.DoFinishTestCase(strTestCase);
            }

            SCManagerProfiler.DoPrintResult_PrintLog_IsError(true);
        }