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
AbAb 

System.assert(false); inside test class

Hello,

What does below code mean in Test class and what is the purpose?
System.assert(false);
thanks for suggestion
 
Best Answer chosen by Ab
Nehashri320Nehashri320
Hi Sandrine,
  System.assert() can take two parameters , one  mandatory and one optional. The first parameter would be any condition you want to verify , which returns true or false and the second opne is the message you want to display if the condition from the first parameter is false. It is very useful for debugging test classes , if the tes tclass is failing.
You can refer to this link.
http://cloudisfuture.blogspot.com/2012/04/system.html

Thank you

All Answers

Nehashri320Nehashri320
Hi Sandrine,
  System.assert() can take two parameters , one  mandatory and one optional. The first parameter would be any condition you want to verify , which returns true or false and the second opne is the message you want to display if the condition from the first parameter is false. It is very useful for debugging test classes , if the tes tclass is failing.
You can refer to this link.
http://cloudisfuture.blogspot.com/2012/04/system.html

Thank you
This was selected as the best answer
sfdcMonkey.comsfdcMonkey.com
hi sandrine
verify the behavior of code we use System.assert() method . for better understand go to below links
https://techman97.wordpress.com/2013/10/07/why-you-should-use-system-assert/
https://salesforce-parth.blogspot.in/2016/07/salesforce-systemassertmethods.html
i hope it helps you
let me inform if it helps you
thanks