Exemple #1
0
 private Tester.TestAuditInfo getAuditInfo(MethodInfo method, TestedAttribute attribute)
 {
     return(new Tester.TestAuditInfo
     {
         Name = method.Name,
         Status = attribute.Status,
         TestDescription = attribute.TestDescription,
         TestReference = attribute.TestReference
     });
 }
Exemple #2
0
        private Tester.TestAuditInfoType ProcessType(Type type, TestedAttribute typeAttribute)
        {
            Tester.TestAuditInfoType typeInfo = null;
            if (typeAttribute != null)
            {
                typeInfo = new Tester.TestAuditInfoType()
                {
                    Name            = type.Name,
                    TestReference   = typeAttribute.TestReference,
                    TestDescription = typeAttribute.TestDescription,
                    Status          = typeAttribute.Status,
                    ObjectType      = type,
                };

                var methods = type.GetMethods().ToList();
                foreach (var method in methods)
                {
                    if (method.IsPublic && !method.IsSpecialName && method.IsHideBySig)
                    {
                        // process method if it is public and not a property
                        processMethod(typeInfo, method);
                    }
                }
            }
            else
            {
                // undocumented, create info as needed
                typeInfo = new Tester.TestAuditInfoType()
                {
                    Name            = type.Name,
                    TestReference   = "NA",
                    TestDescription = "No Test Attribute Defined",
                    Status          = TestedAttribute.TestStatus.Untested,
                    ObjectType      = type,
                };
            }
            return(typeInfo);
        }