May I know how I can create a code coverage for if statement code? Here is my if statement code:
@AuraEnabled
public static void submitFinalApproval(Id recordId) {
//1. RS
if(String.valueOf(recordId).startsWith('a0O')){
update new Return_Shipment__c(Id = recordId, Final_Approved__c = true);
}
//2. VO__c
if(String.valueOf(recordId).startsWith('a0G')){
update new VO__c(Id = recordId, Final_Approved__c = true);
}
//3. RPR__c
if(String.valueOf(recordId).startsWith('a0A')){
update new RPR__c(Id = recordId, Final_Approved__c = true);
}
}
recordId.getSObjectType()
.