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

how to write a test class for this following trigger
for(Contracting_Status__c cs : trigger.New) { if(trigger.isInsert) contractingid.add(cs.id); if(cs.Account__c != null && (cs.Contracting_Status__c != null)) contrct_Accntid.add(cs.Account__c); if(cs.Carrier__c != null && (cs.Contracting_Status__c != null)) Carrier_id.add(cs.Carrier__c); if(cs.Agency__c != null && (cs.Contracting_Status__c != null)) Contrct_Agencyid.add(cs.Agency__c); if(trigger.isUpdate && cs.Agreement_release_date__c <= system.today()) Contract_Id.add(cs.id); system.debug(cs.Carrier__c+'****PRINT CARRIER NAME****'); if(cs.Product_Type__c != null && cs.Carrier__c == '00180000010mfZlAAI') ProductCode = cs.Product_Type__c; }
Thank you.
This data you insert would be in the test class.
Contracting_Status__c cs = new Contracting_Status__c();
insert cs;
just the above line in the test class would run your trigger. To cover each and every line you just have to take care of putting in the right data.
Hope it helps.
prady01
All Answers
This data you insert would be in the test class.
Contracting_Status__c cs = new Contracting_Status__c();
insert cs;
just the above line in the test class would run your trigger. To cover each and every line you just have to take care of putting in the right data.
Hope it helps.
prady01