Exploring the Rule classes

So far we have concentrated on the Stock class. Let us now turn our attention to the rule classes.

Note

From this point in the book, we will look at the implementation code, and then show how we can test it effectively. Note, however, that this does not mean writing the code first, followed by the unit test. The TDD process is still test first, followed by the implementation. It is the test case which will drive the implementation strategy. We are showing the implementation code first, only because it makes it easier to understand the testing concepts that will follow. All this code was originally written test first!

The rule classes keep track of the rules that the user wants to track and they can be of different types. ...

Get Test-Driven Python Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.