top-meta
top-meta copied to clipboard
Unit Testing Part 2: Mocks and Stubs
Summary
We need a lesson to introduce students to mocks and stubs and their uses in unit tests.
Acceptance Criteria
Lesson content should cover:
- [ ] What are mocks.
- [ ] What are command methods?
- [ ] What are stubs?
- [ ] How to use them.
- [ ] Disadvantages.
- [ ] Exercise: Finish mocking more of the example projects crud actions to its database.
- [ ] Exercises: Mock a weather service response in a test to make it predicable.
- [ ] Exercises: Mock a quote of the day service response in a test to make it predicable.
- [ ] Exercises: Mock a database service response that takes a while in a test to make the test fast.