QuestionQ77

Testing

Universal Containers (UC) is implementing Salesforce and wants all adverse conditions to be covered by unit tests for custom code.

Which two test-class best practices should an Architect recommend during implementation?

Choose two
  • A Execute test classes under various profiles.
  • B Test classes must use existing data in the environment.
  • C Test data must have positive as well as negative data.
  • D Test classes should NOT create custom settings data.
Explanation

Effective Apex unit tests cover both valid and invalid inputs, including expected error or exception behavior. They also test permission and sharing behavior by executing code in different user contexts, such as users with different profiles. Test classes should be self-contained rather than depend on existing organization data, and controlled configuration data can be created when required.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!