function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ElectronElectron 

One testClass test one trigger or could test multiple triggers?

After finished my trigger and my unit test, I am starting to write my next one.

I know I should write the test class first.

 

When I run the test, my new trigger already has 56% test cover. 

The new trigger is related to same SObject, but I still think the number is not correct. 

 

So I had this idea, if these trigger works on same Object, I feel write the test method in one class seems more efficient. 

Best Answer chosen by Admin (Salesforce Developers) 
hitesh90hitesh90

Hi,

 

Yes, You can write single Test Class for multiple Triggers.

 

Thank You,

Hitesh Patel

All Answers

hitesh90hitesh90

Hi,

 

Yes, You can write single Test Class for multiple Triggers.

 

Thank You,

Hitesh Patel

This was selected as the best answer
ElectronElectron
Great, thanks so much.

This is the best community.