You need to sign in to do that
Don't have an account?
JamesForce
How to write testing code for static property?
1 public static String AvatarUploadFolderDevname {
2 get {
3 return AVATAR_UPLOAD_DEFAULT_FOLDER_DEVNAME;
4 }
}
I wrote line like String str = Class.AvatarUploadFolderDevname; this only cover line#3, leave line#1 as red, not covered
this only cover
Not working, already tried that
I gues this oculd be related how code coverage is calculated. I did some reseach on that, without luck
Regardless, simply referencing the field (and thus invoking the getter) should be sufficient to include code coverage. We have a number of static variables in our project that are mostly covered (if not all).