mardi 5 avril 2016

Test coverage using test classes for parent child relationship in salesforce

I am new to Salesforce. i am stuck in a test coverage part.

Can anyone please suggest how to cover these relationships 'r1.REQ_A__r.V_N__r.San__c' inside a for loop?

for(Pay__c r1:[SELECT REQ_A__r.V_N__r.San__c,REQ_C__r.V_N__r.San__c FROM Pay__c where Id in: sPReqId and Cmpny__c in ('11','12','10')           
                           and Ex_T__c in ('Adb','car')])            
                           {            
                               if(r1.REQ_A__r.V_N__r.San__c==null)          
                               {            
                               mPReq.put(r1.P_San_No__c,r1);            
                               }            
                               else         
                               {            
                               if((r1.REQ_C__r.V_N__r.San__c==null)  
                               {                                        
                               mpPReq.put(r1.REQ_A__r.V_N__r.San__c,r1);           


                               }            
                               }            

                              if(r1.REQ_C__r.V_N__r.San__c==null)          
                               {            
                               mPReq.put(r1.P_San_No__c,r1);            
                               }            

                           }            

Thanks

Aucun commentaire:

Enregistrer un commentaire