You need to sign in to do that
Don't have an account?
PremKumar Mohandass
Assertions
Hi,
Can anyone tell me the actual difference between system.assert() and system.assertequals()?
Thanks in Advance,
Prem.
Can anyone tell me the actual difference between system.assert() and system.assertequals()?
Thanks in Advance,
Prem.
With system.assertEquals() you pass in the actual & expected values as your first two arguments and an optional error message. The method evaluates if the actual & expected values are equal, and returns true if so; if not, it returns false with the custom message passed in.
Reference links:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_system.htm
https://th3silverlining.com/2010/09/07/salesforce-system-assert-vs-system-assertequals/
All Answers
With system.assertEquals() you pass in the actual & expected values as your first two arguments and an optional error message. The method evaluates if the actual & expected values are equal, and returns true if so; if not, it returns false with the custom message passed in.
Reference links:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_system.htm
https://th3silverlining.com/2010/09/07/salesforce-system-assert-vs-system-assertequals/
Thanks for the reply and links :)
Regards,
Prem.