You need to sign in to do that
Don't have an account?

Method is not getting cover in the test class
Hi All i need help for the below lines to cover in the test class can you please help me to cover the class.
public void autoPopulateSrcAccount(){
if(rih.Source_Inventory__c != null)
{
MedConnect__Inventory_Header__c invh =[select id,MedConnect__Location__c from MedConnect__Inventory_Header__c where Id =: rih.Source_Inventory__c];
rih.Source_Account__c = invh.MedConnect__Location__c;
}
}
public void autoPopulatedesAccount(){
if(rih.Destination_Inventory__c != null)
{
MedConnect__Inventory_Header__c invh =[select id,MedConnect__Location__c from MedConnect__Inventory_Header__c where Id =: rih.Destination_Inventory__c];
rih.Destination_Account__c = invh.MedConnect__Location__c;
}
}
thanks in Advance.
public void autoPopulateSrcAccount(){
if(rih.Source_Inventory__c != null)
{
MedConnect__Inventory_Header__c invh =[select id,MedConnect__Location__c from MedConnect__Inventory_Header__c where Id =: rih.Source_Inventory__c];
rih.Source_Account__c = invh.MedConnect__Location__c;
}
}
public void autoPopulatedesAccount(){
if(rih.Destination_Inventory__c != null)
{
MedConnect__Inventory_Header__c invh =[select id,MedConnect__Location__c from MedConnect__Inventory_Header__c where Id =: rih.Destination_Inventory__c];
rih.Destination_Account__c = invh.MedConnect__Location__c;
}
}
thanks in Advance.
insert the test data for MedConnect__Inventory_Header__c object and call the class method in test class like classname.autoPopulateSrcAccount();
If this helps, Please mark it as best answer.
Thanks!!