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
SF DEVSF DEV 

Tescase Error Coverage

trigger.new[0].addError('Please select Region');

 

 

How to cover adderror line in test, Its inside IF() Condition, Able to cover if() statement. But not adderror statement!!

Rahul SharmaRahul Sharma
Write the piece of code in try catch block(In test class) from where this trigger is been called.
Due to the error generated in test class, Further lines would not get cover.