2

this is probably a simple question, but one that I've never been clear on. My client has a utility class with a lot of methods used for generating objects (users, accounts, etc.). Almost every method in the class is a utility method, except for one, which is a testMethod (old school way of combining testMethods in your classes). At the very top of the class they have @isTest.

@isTest
public class TestUtility{
    public static User getUser(){
    ....
    return user;
   }
etc. etc.
public static testMethod void myTest(){
...
}}

My colleagues and the client both think that by having @isTest at the top of the class, Salesforce will skip this class entirely and not count any of it towards code coverage. However, I still see it as mostly 'uncovered' when I run all tests. Can someone please tell me, who is correct? Thanks!

1 Answer 1

7

Code coverage does not include any classes which are annotated with @isTest. The UI will show them as uncovered, but they do not count towards your organization's 75% code coverage requirements.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .