You need to sign in to do that
Don't have an account?

Test class for retrieving apex class object
IM using this query List<ApexClass> classes = [select ApiVersion, Body, BodyCrc, CreatedById, CreatedDate, Id, IsValid, LastModifiedById, LastModifiedDate, LengthWithoutComments, Name, NamespacePrefix, Status, SystemModstamp from ApexClass LIMIT 10000];
to get all apex class in my org. I want to write test class for this but dont know how to cover this query can anyone help
to get all apex class in my org. I want to write test class for this but dont know how to cover this query can anyone help

ApexClass is a metadata object, not a standard sObject. Your actual, deployed Apex classes are visible in test context by querying ApexClass object.