November 2024
Intermediate to advanced
300 pages
7h 12m
English
For the final increment, Madhu tells you that you’ll need to capture and save a timestamp for each purchase or sale. He indicates that later requirements will need this information. These are the current requirements:
Provide details about the last transaction (purchase or sale) made, including the timestamp.
Produce a list of all transactions, ordered reverse-chronologically.
You choose to start with the requirement for the last transaction. Before you forget, you drop a zero-based test in place:
| | @Test |
| | void returnsNullWhenNoPreviousTransactionMade() { |
| | assertNull(portfolio.lastTransaction()); |
| | } |
The next test, a one-based test for the last transaction, ...
Read now
Unlock full access