GOOS Book Distilled Part 3

A follow through of the great book Growing Object-Oriented Software, Guided by Tests with code

1 minute read

This is a series of blog posts going through the great book Growing Object Oriented Software Guided By Tests, typing in code chapter by chapter, trying to add some of my own understanding where things may not be easy to grasp in the book. I highly recommand you get a copy of the book and follow along with me. Happy coding.

In this post, we start our second acceptance test.

Sniper makes a higher bid but loses.

To be able to implement this, there are 2 fundamental functionalities missing.

The fake auction server needs to report price changes.

The sniper needs to how to bid according to the price reports.

The first is easy, the auction server just sends a PRICE message in the chat. The format of the message is

"SOLVersion: 1.1; Event: PRICE; CurrentPrice: 1000; Increment: 98; Bidder: other bidder;"

We will leave the second one to later.

To be able to run multiple tests consecutively. We need to disconnect the connection when the window closes. So the next test can run in a clean slate.

We also did some refactoring.

This wraps up this post, in the next post, we will try this outside in approach by writing our first unit test. Stay tuned.

Source code

comments powered by Disqus