You need to sign in to do that
Don't have an account?
SFDC n12
Test class help needed
Hi,
can you tell me how to cover the following methods in my test class,
private void getusers()
{
usr = AF_DealerCRM_Utility.getUserInfo();
}
***************************************************************************
public AF_AccountExtension()
{
exRepList = [Select Name,URL__c,Report_Link__c,Short_Description__c,Primary_Contact__c,Storage_Location__c,FileNameFilter__c from External_Reports__c Where isActive__c = true AND FileNameFilter__c != 'PDN'];
if(usr == null)
{
getusers();
}
system.debug('userprofilename'+usr.profile.name);
if((usr.profile.name !='AF: RVP' ) && (usr.profile.name !='AF: Account Executive') && ( usr.profile.name !='AF: Director of Sales'))
{
exRepList = null;
repLink = null;
Apexpages.addMessage(new apexpages.message(Apexpages.Severity.ERROR,System.Label.AF_Home_Page_Reports));
}
Thanks in Advance
can you tell me how to cover the following methods in my test class,
private void getusers()
{
usr = AF_DealerCRM_Utility.getUserInfo();
}
***************************************************************************
public AF_AccountExtension()
{
exRepList = [Select Name,URL__c,Report_Link__c,Short_Description__c,Primary_Contact__c,Storage_Location__c,FileNameFilter__c from External_Reports__c Where isActive__c = true AND FileNameFilter__c != 'PDN'];
if(usr == null)
{
getusers();
}
system.debug('userprofilename'+usr.profile.name);
if((usr.profile.name !='AF: RVP' ) && (usr.profile.name !='AF: Account Executive') && ( usr.profile.name !='AF: Director of Sales'))
{
exRepList = null;
repLink = null;
Apexpages.addMessage(new apexpages.message(Apexpages.Severity.ERROR,System.Label.AF_Home_Page_Reports));
}
Thanks in Advance
Please create an object of this class in the test class and that should do it read more: https://developer.salesforce.com/forums?id=906F00000008zbRIAQ
usr = AF_DealerCRM_Utility.getUserInfo();
how to call the abve method in my test class , the getuserinfo() methd is from another class and i am using it in my controller
Good luck. Hope that helps.
take a look at this post
http://abhithetechknight.blogspot.in/2013/10/salesforce-test-class-basics.html
Regards,
Abhi Tripathi
Salesforce Ceritified Developer