Salesforce Fact #100 | Sharing variable in test class

Suppose, we want to use a variable in all the test methods of a test class. So, we can define a static variable and use that in the test methods. But the point is, every testMethod begins with a new scope i.e. whatever changes made to the variable in the previous test method is not stored.

Attached is the screenshot.



Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow