How can the developer meet these requirements? A developer needs to - ProProfs Discuss
Topics
Products
Follow Us:

How can the developer meet these requirements?
A developer needs to write tests to ensure that code doesn't fail when it is deployed to a different organization.The developer also must ensure that the code works properly with organization sharing rules and ensure that the code mitigates errors due to limits.

How can the developer meet these requirements?<br/>A developer needs to write tests to ensure that code doesn't fail when it is deployed to a different organization.The developer also must ensure that the code works properly with organization sharing rules and ensure that the code mitigates errors due to limits.

Change Image    Delete



A. Create all test data before calling the Test. startTest () and Test .stopTest () methods.
B. Handle all exceptions that are caught by adding an empty catch ( Exception e) statement.
C. Use SeeAllData=true to avoid delaying tests due to creating test data.
D. Use the runAs ( ) method to test the application in different user contexts.

This question is part of PD2-2
Asked by Pal, Last updated: Feb 09, 2020

+ Answer
Request

5 Answers

devilzP

DevilzP

Answered Apr 05, 2018

Create all test data before calling the Test. startTest () and Test .stopTest () methods.

Use the runAs ( ) method to test the application in different user contexts.



Limit exceptions cannot be caught my friend :)

 

srinivasitcrre

Srinivasitcrre

Answered Jan 18, 2018

Answers are: Create all test data before calling the Test. startTest () and Test .stopTest () methods. Use the runAs ( ) method to test the application in different user contexts.

Test class best practises says not to just leave the empty catch block.

  • Always handle all exceptions that are caught, instead of merely catching the exceptions.
 

John Adney

John Adney

Answered Nov 04, 2017

I think the answer is :

Create all test data before calling the Test. startTest () and Test .stopTest () methods.

Use the runAs ( ) method to test the application in different user contexts.

 

Pav

Pav

Answered Nov 04, 2017

I think the answer is :

Create all test data before calling the Test. startTest () and Test .stopTest () methods.

Use the runAs ( ) method to test the application in different user contexts.

 

Pal

Pal

Answered Nov 04, 2017

Handle all exceptions that are caught by adding an empty catch ( Exception e) statement.
Use the runAs ( ) method to test the application in different user contexts.
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.