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
JayDP123JayDP123 

Test system.assertEquals

Hi,

 

Does SalesForce only allow 1 system.assertEquals in a test.method? I have tried with more than one but when I look at the test result it says only 1 test passed. 

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox
You may have as many asserts as you desire. Each "pass" in the Run Tests area means that the entire test passed; no errors were thrown and not caught, and no asserts failed. Each testMethod is a single test, and can either pass completely or fail completely (there is no "partial pass").

All Answers

sfdcfoxsfdcfox
You may have as many asserts as you desire. Each "pass" in the Run Tests area means that the entire test passed; no errors were thrown and not caught, and no asserts failed. Each testMethod is a single test, and can either pass completely or fail completely (there is no "partial pass").
This was selected as the best answer
JayDP123JayDP123
Ah cool so the pass if for the entire method. Thought it might be the case.

Thanks!