You need to sign in to do that
Don't have an account?

This is the code provided by Salesforce for the CommunityLandingController but it yields on 33% coverage. This is killing my overall and I need to improve it. Help!
public with sharing class CommunitiesLandingController { // Code we will invoke on page load. public PageReference forwardToStartPage() { String communityUrl = 'https://universaltelcom.force.com'; String customHomePage = '/apex/hello'; if (UserInfo.getUserType().equals('Guest')) { return new PageReference(communityUrl + '/login?startURL=' + EncodingUtil.urlEncode(customHomePage, 'UTF-8')); }else { return new PageReference(communityUrl + customHomePage); } } public CommunitiesLandingController() {} }
https://developer.salesforce.com/page/Apex_Testing_with_RunAs
Please let us know if that will help you.
Thanks
Amit Chaudhary