Hi I have created an apex class as seen below for an Apex Visualforce page. But I am having a hard time creating the test class for the code. I would appreciate any help.
public class CC2TemplateController {
public String pref = 'yahoo.com';
PageReference pr;
public String globalNav {get;set;}
public String navmobileRadioButtons {get;set;}
public String navmobile {get;set;}
public String logo {get;set;}
public String nav {get;set;}
public String noscript {get;set;}
public String backToTop {get;set;}
public String footer {get;set;}
public CC2TemplateController() {
if (String.isNotBlank(Label.CC2WarrantyTemplateUrl)) {
pref = Label.CC2WarrantyTemplateUrl;
}
string temp = 'http://' + pref + '/includes/globalnav.html';
system.debug(':::PageRference globalnav:::' + temp);
pr = new PageReference(temp);
globalNav = pr.getContent().toString();
pr = new PageReference('http://' + pref + '/includes/navmobile-radio-buttons.html');
navmobileRadioButtons = pr.getContent().toString();
pr = new PageReference('http://' + pref + '/includes/navmobile.html');
navmobile = pr.getContent().toString();
pr = new PageReference('http://' + pref + '/includes/logo.html');
logo = pr.getContent().toString();
pr = new PageReference('http://' + pref + '/includes/nav.html');
nav = pr.getContent().toString();
pr = new PageReference('http://' + pref + '/includes/noscript.html');
noscript = pr.getContent().toString();
pr = new PageReference('http://' + pref + '/includes/back-to-top.html');
backToTop = pr.getContent().toString();
pr = new PageReference('http://' + pref + '/includes/footer.html');
footer = pr.getContent().toString();
}
}