1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
fgiga [73]
3 years ago
7

When writing test methods, what functionality is verified by the system method "runAs()"?

Computers and Technology
1 answer:
olchik [2.2K]3 years ago
4 0

Answer:

The main functionality verified by this test method command is user sharing record.

Explanation:

Generally, every apex code runs in system mode.

Apex is strong object-oriented programming language that allows the developers to execute flow and transaction control.

Using syntax which look like java and acts as databases, Apex allows the developer to add any type of business logics to an event which can include button, clicks records or visual pages.

Apex code can be initiated by web service request.  

The permissions and record sharing of current user are not consider by apex codes.

Now the system method runAs() will allow you to take or write a test method which will basically change the user context to an existing or an new user, so that the record sharing will take place.

runAs() command will not change or anything done with user permissions or permission levels, it will only record sharing of the user.  

When you use runAs() command the original and true context will run after the test method is once completed under the command of runAs().

The runAs() has no concern with the user license.  

If there is no or expired your personal or organization license you can just make a new user with this runAS() command.

In using this command we have to make a private class by the name of this test and then our further code to make a user , afterwards  which we will the true and original code of ours which we want to run.

There are many other uses of runAs() like  

 Mixed DML operations in test by opening the DML operations.

 We can also use it as a version which will take a package as a version argument. This will cause the code a specific version.

runAs(System.Version) is the command used for this.

You might be interested in
Which of the constraints listed below would be considered a physical constraint
timurjin [86]
Materials

materials are the only physical thing
8 0
3 years ago
What is the default junk email protection in Outlook 2016?
Shtirlitz [24]
The answer to ur question is D
4 0
3 years ago
Read 2 more answers
Which of the following is used to track and gather information without knowledge or authorization?
harkovskaia [24]
It might be spyware... but i might be wrong.
3 0
3 years ago
Read 2 more answers
A bag of biscuit can hold 22 biscuit, and a container can hold 70 bags of biscuit. Write a program that prompts the user to ente
Marta_Voda [28]
The answer is left over bags that make turtles sick
5 0
3 years ago
Read 2 more answers
Which of the following is the correct procedure for adding a design theme to a PowerPoint presentation ?
Eva8 [605]

Answer:

B. Design > Theme > choose a theme

Explanation:

-Applying themes-

  • Select the Design tab on the Ribbon, then locate the Themes group. Each image represents a theme.
  • Click the More drop-down arrow to see all available themes.
  • Select the desired theme.
  • The theme will be applied to the entire presentation. To apply a different theme, simply select it from the Design tab.
6 0
2 years ago
Other questions:
  • For a project called "The Sheep Market", Aaron Koblin collected drawings of sheep from strangers on the Internet. He posted the
    14·1 answer
  • This exercise asks you to write a program that tests some of the built-in subroutines for working with Strings. The program shou
    12·1 answer
  • What is the khan academy game where it is a block having to jump over lava and is an endless runner
    9·1 answer
  • PLEASE HELP!<br> How do you "brainliest" an answer?
    13·2 answers
  • What is the dividend rate for ibm stock?
    6·1 answer
  • Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any
    9·1 answer
  • Este tipo de software sirve para controlar e interactuar con el sistema operativo, proporcionando control sobre el hardware y da
    11·1 answer
  • Your network has been having problems lately when users are participating in video conferences - the video and audio stutters ve
    13·1 answer
  • Explain any two features of a computer​
    15·1 answer
  • 1.a computer can create an output based on the input of the user.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!