Improve Apex Testing with New SObject Error Methods

Basically this Winter 21 update for improve test class error methods. Salesforce introduce two new methods SObject.hasErrors() and SObject.getErrors(). With this methods we can track errors without performing a DML operation to check the result for errors. Dynamically add errors…