You need to sign in to do that
Don't have an account?
Varun Annadata
How to cover this code in test class?
set<Id> pmIds = new set<id>();
for(Medical_History_MVN__c mdh : medicalhistorys) {
pmIds.add(mdh.Program_Member_MVN__c);
System.debug('mdh:'+mdh);
}
lstMH = [Select id,Program_Member_MVN__c,Diagnosis_Start_Date_C1__c,Primary_ICD_10_CM_Code_C1__c, Secondary_ICD_10_CM_Code_C1__c, Primary_ICD_10_CM_Code_C1__r.id,
Secondary_ICD_10_CM_Code_C1__r.id from Medical_History_MVN__c WHERE RecordType.DeveloperName = 'Diagnosis'
and Program_Member_MVN__c IN :pmIds];
How to cover the "pmIds" in test class?
for(Medical_History_MVN__c mdh : medicalhistorys) {
pmIds.add(mdh.Program_Member_MVN__c);
System.debug('mdh:'+mdh);
}
lstMH = [Select id,Program_Member_MVN__c,Diagnosis_Start_Date_C1__c,Primary_ICD_10_CM_Code_C1__c, Secondary_ICD_10_CM_Code_C1__c, Primary_ICD_10_CM_Code_C1__r.id,
Secondary_ICD_10_CM_Code_C1__r.id from Medical_History_MVN__c WHERE RecordType.DeveloperName = 'Diagnosis'
and Program_Member_MVN__c IN :pmIds];
How to cover the "pmIds" in test class?
Insert a record of Medical_History_MVN__c in your test class with all the conditions used in SOQL Query.
Medical_History_MVN__c mh = new Medical_History_MVN__c ( required fields)
insert mh;
Thanks
Lokesh