Improve Apex Testing with New SObject Error Methods
Basically, this Winter 21 update for improve test class error methods. Salesforce introduced two new methods SObject.hasErrors() and SObject.getErrors(). With this method, we can track errors without performing a DML operation to check the result for errors. Dynamically add errors…