Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 92 discussion

Actual exam question from Salesforce's CRT-450
Question #: 92
Topic #: 1
[All CRT-450 Questions]

Given the code below, what can be done so that recordCount can be accessed by a test class, but not by a non-test class?

  • A. Change recordCount from private to public.
  • B. Add the SeeAllData annotation to the test class.
  • C. Add the TestVisible annotation to recordCount.
  • D. Add the TestVisible annotation to the MyController class.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
_ApexPredator_
Highly Voted 1 year, 11 months ago
Selected Answer: C
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_testvisible.htm
upvoted 5 times
...
ABHI0O07
Most Recent 8 months ago
@TestVisible annotation
upvoted 1 times
...
helper_raw
11 months, 4 weeks ago
Selected Answer: C
C is correct TestVisible Annotation Use the TestVisible annotation to allow test methods to access private or protected members of another class outside the test class.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...