+ Start a Discussion
alexjalexj 

Test which execute two triggers

I want to know if a test method can execute two triggers.

My test class should test a trigger after insert lead but to test this, i should insert account and i have a trigger after insert account too.

I feel that only the first trigger run.

Can you help me to understand ? 

JeffStevensJeffStevens

You shouldn't have to insert the account also.  The Lead can be inserted as a stand alone record.  But - if your test class inserts an Account record - then the trigger on the Account object will fire.  If your same test class inserts a Lead record, then the trigger on the lead will also fire.