function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
neao18neao18 

How to get code cover for Enum class in APEX

I have a Enum class as:

global class Util {
  global enum Session {
  Winter,
  Summer,
  Rain
 }
}

and a test class as :

public static testmethod void callTestData(){
test.starttest();
    Util.Session se = Util.Session.Winter;
test.stoptest();
}

But still my code coverage is 0%?? Why.

Also I tried many ways to cover it but not able to can any one help!!

Subramani_SFDCSubramani_SFDC

check this link...it may help you....

 

http://salesforce.stackexchange.com/questions/20998/how-to-get-code-cover-for-enum-class-in-apex

 

 

Thanks and regards,

Subra.J

Trinay Technologies

neao18neao18

 That is my post only!! I am not getting any answers there so i also posted it here

sfdcfoxsfdcfox
This class has no methods, and so it won't have any coverage. You need at least one line of executable code to get more than 0% coverage. On the other hand, since there are no lines of executable code, it will not harm against your organization's code coverage statistic.