+ Start a Discussion
Ramk123Ramk123 

Code Coverage help for part of Apex code

Please help to write a test class for below part apex logic 

   private void populateRequesterInfo() {
        if(CommonUtil.isNotBlank(this.caseObj.isApplicantPA__c) && 'No'.equalsIgnoreCase(this.caseObj.isApplicantPA__c)) {
            this.contactObj.FirstName = trimLongText(this.caseObj.Requester_First_Name__c, 40);
            this.contactObj.LastName = this.caseObj.Requester_Last_Name__c;
            this.contactObj.Phone = this.caseObj.Requester_Home_Phone__c;
            this.contactObj.MobilePhone = this.caseObj.Requester_Cell_Phone__c;
            this.contactObj.MailingStreet = buildMailingStreet(this.caseObj.Requester_Mail_to_Address__c, this.caseObj.Requester_Apt__c);
            this.contactObj.Apt__c = this.caseObj.Requester_Apt__c;
            this.contactObj.MailingCity = this.caseObj.Requester_Mail_to_City__c;
            this.contactObj.MailingState = this.caseObj.Requester_Mail_to_State__c;
            this.contactObj.MailingPostalCode = null != this.caseObj.Requester_Mail_to_Zip_Postal_Code__c ?  String.valueOf(this.caseObj.Requester_Mail_to_Zip_Postal_Code__c) : '';
            this.contactObj.Email = this.caseObj.Requester_Email__c;
            this.contactObj.Region__c = this.caseObj.Requester_Region__c;
            this.contactObj.County__c = this.caseObj.Requester_County_of_Residence__c;
Best Answer chosen by Ramk123
Ramk123Ramk123
Archived code coevrage to private method by passing like : controler.contactObj.isApplicantPA__c = 'No' ;