5. Dependency Inversion
MediumSOLID1 hidden requirement
Taking a collaborator in rather than reaching out and building one
SalesReport is handed an OrderStore and ignores it, constructing a MySqlOrderStore of its own instead. The tests pass, because that is the store they use.
Rewrite SalesReport so it uses the store it was given.
Run compiles every file and runs Tests.java — the tests you can read.
Submit runs those again, then applies 1 requirement you have not seen, one at a time.
Your code is never edited. Each requirement is added to the project as it stands. If the design is right, nothing you wrote has to change.
- Ctrl/⌘ + Enter runs the tests
Run the tests to see where you are.
Hidden requirements
Stdout
TERMINALPROBLEMSOUTPUT
Try:
honeytrap shell. Two commands are wired up: cd and cat.