"A developer wants multiple test classes to use the same set of test data."
Since we are saying classes , you would need the test utility.
If the question was "A developer wants multiple test methods to use the same set of test data."
Then @testsetup would be the more likely answer.
The key to remember is that the test data under the @TestSetup exists for the running of that Test class only. It is available to all methods in that class, but not to other classes, or methods in other classes.
Hi Ifthikar, Normally, We use to follow this approach, creating Utility class for all records to be created and reused by various test classes. And from individual testSetup, call those utility methods. Since, the issue is @testsetup should be used in individual test classes and cannot be reused from other test classes that's why we have taken this approach.
"A developer wants multiple test classes to use the same set of test data."
Since we are saying classes , you would need the test utility.
If the question was "A developer wants multiple test methods to use the same set of test data."
Then @testsetup would be the more likely answer.
The key to remember is that the test data under the @TestSetup exists for the running of that Test class only. It is available to all methods in that class, but not to other classes, or methods in other classes.
"A developer wants multiple test classes to use the same set of test data."
Since we are saying classes , you would need the test utility.
If the question was
"A developer wants multiple test methods to use the same set of test data."
Then @testsetup would be the more likely answer.
The key to remember is that the test data under the @TestSetup exists for the running of that Test class only. It is available to all methods in that class, but not to other classes, or methods in other classes.
Regards
Andrew
All Answers
Normally, We use to follow this approach, creating Utility class for all records to be created and reused by various test classes.
And from individual testSetup, call those utility methods.
Since, the issue is @testsetup should be used in individual test classes and cannot be reused from other test classes that's why we have taken this approach.
Thank You
www.nubeselite.com
Developement | Training | Consulting
Please mark this as solution if your problem resolved.
I would say the answer is 'D'
Thank You
www.nubeselite.com
Developement | Training | Consulting
Please mark this as solution if your problem resolved.
"A developer wants multiple test classes to use the same set of test data."
Since we are saying classes , you would need the test utility.
If the question was
"A developer wants multiple test methods to use the same set of test data."
Then @testsetup would be the more likely answer.
The key to remember is that the test data under the @TestSetup exists for the running of that Test class only. It is available to all methods in that class, but not to other classes, or methods in other classes.
Regards
Andrew