October 2009
Intermediate to advanced
384 pages
8h 54m
English
In which we add another feature to our Sniper and let it win an auction. We introduce the concept of state to the Sniper which we test by listening to its callbacks. We find that even this early, one of our refactorings has paid off.
We have a Sniper that can respond to price changes by bidding more, but it doesn’t yet know when it’s successful. Our next feature on the to-do list is to win an auction. This involves an extra state transition, as you can see in Figure 14.1:
Figure 14.1 A sniper bids, then wins

To represent this, we add an end-to-end test based on sniperMakesAHigherBidButLoses() ...