Creating Test Data
After we have finished all lessons of this topic, we:
- Know the pros and cons of the
newkeyword, factory methods, and test data builders. - Can create test data by using the
newkeyword, factory methods, and test data builders. - Can select the right tool for the job.
Lessons
- Introduction to System Under Test
- Creating Test Data With the New Keyword: The Telescoping Constructor (Anti)Pattern
- Creating Test Data With the New Keyword: The JavaBeans Style Construction
- Introduction to Factory Methods
- Creating Test Data With Factory Methods: Using Local Factory Methods
- Creating Test Data With Factory Methods: Using an Object Mother Class
- Creating Our First Test Data Builder
- Creating Stateful Objects With Test Data Builders
- Overriding a Builder With a Test Data Builder
- Emphasizing the State of the Created Object