function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
m 3m 3 

could you please another class also there need to write test class please help me

/**
 * Controller class for C_Header component
 */
public without sharing class C_HeaderCntl {
    @AuraEnabled
    public static String getContactTypeDetail(){
        return C_Utilities.getContactTypeDetail();
    }
}
Raj VakatiRaj Vakati
Try this
 
@isTest 
private class C_HeaderCntlTest {
    static testMethod void C_HeaderCntlTestExMe() {
Account testAccount = new Account(); 
testAccount.Name='Test Account' ;
 insert testAccount;
 Contact cont = new Contact(); 
cont.FirstName='Test'; 
cont.LastName='Test';
 cont.Accountid= testAccount.id; 
insert cont;

     C_HeaderCntl.getContactTypeDetail();
    }
}

 
v varaprasadv varaprasad
Hi 

Try this :
 
@isTest 
private class C_HeaderCntlTest {
    static testMethod void C_HeaderCntlTestExMe() {
Account testAccount = new Account(); 
testAccount.Name='Test Account' ;
 insert testAccount;
 Contact cont = new Contact(); 
cont.FirstName='Test'; 
cont.LastName='Test';
 cont.Accountid= testAccount.id; 
insert cont;

    string resp = C_HeaderCntl.getContactTypeDetail();
	system.debug('resp'+resp);
    }
}

Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.


Thanks
Varaprasad
Salesforce Freelance Consultant/Developer/Administrator
@For Salesforce Project Support: varaprasad4sfdc@gmail.com


Salesforce latest interview questions  :
https://www.youtube.com/channel/UCOcam_Hb4KjeBdYJlJWV_ZA?sub_confirmation=1