+ Start a Discussion
Guru 91Guru 91 

How to get test coverage for this class?

Hi ,
How to get test coverage for this class.

global abstract class PageControllerBase {

    public Boolean showHeader {get; set;}
    
    public PageControllerBase() {
        showHeader = true;
        String headerParameter = ApexPages.currentPage().getParameters().get('showHeader');
        if ('false' == headerParameter || 'no' == headerParameter) {
            showHeader = false;
        }
        String userAgent = ApexPages.currentPage().getHeaders().get('USER-AGENT');
        if (null != userAgent && (userAgent.contains('iPhone') || userAgent.contains('iPad'))) {
            showHeader = false;
        } 
    }
}


Thanks
devedeve
Hi Guru,

Please write the test class for the extended class not for abstract class. It cant be initiated.