A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail.
What is the optimal way for a developer to fix the issue?
A company has many different unit test methods that create Account records as part of their data setup. A new required field was added to the Account and now all of the unit tests fail.
What is the optimal way for a developer to fix the issue?
The optimal way for a developer to fix the issue is to create a TestDataFactory class that serves as the single place to create Accounts for unit tests and set the required field there. This approach centralizes the account creation logic in one place, making it easier to update and maintain. If new required fields are added in the future, the developer only needs to update the factory class, rather than updating every individual test.
B, TestDataFactory is idela way of creating Test data at single place
B is correct
best way to create test methods