This challenge was the second of my Maker's weekly challenges, coded in pairs with a randomised partner each day. The learning objectives for this week were:
- Class splitting to adhere to SRP
- Mocking and decoupling classes in tests
- Testing behaviour over state
- OOP and its' benefits
- Dependency injection
Oystercard is a simple tool to allow your Oystercard to calculate the balance and allow you to use it on TFL.
- It allows a user to create an Oystercard with a default amount, and to add to this balance on the fly.
- The program also sets limits matching those of real Oystercards, and correctly deducts based on your journey.
- The card also stores journies and allows users to access them later.
The purpose of this program is to practice the appropriate usage of TDD principles to allow the seamless integration of new features.