A First Example Part 1
- Present the problem
- You have to add tests. Assume that the application works as is; change no current behavior
- Add test cases for statement method
- What did you add that wasn’t in the book?
- Curious. Why did you choose minitest over rspec?
- I’m noticing some patterns.
- In #setup, you create your Customer and 3 instances of Movie. #setup is the only place that directly class those classes.
- Later, you use @joe in every single test. Cool. You then pass a movie object to the Rental on the first line – for example: Rental.new(@child_movie, 3) and then add the rental to @joe.
- Each test calls #add_rental then looks at @joe.statement.
- How do you feel about this? Is it a good test pattern to call one method (#add_rental) and test its correctness by calling another method (#statement)?
- What do the test names mean? test_2day_new_4day_child_3day_reg
- Can you summarize the objects here and their responsibilities?
- add notes from book stating the problem
- Can you summarize for our listeners?