O'Reilly logo

Fit for Developing Software: Framework for Integrated Tests by Ward Cunningham, Rick Mugridge

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 34. Mocks and Clocks

Programmers: The tables that use this fixture code are given in Chapter 15.

The tests in Chapter 15 were developed to advance the clock and set the time in order to test some parts of the system. Emily and Neo handled the changing date in the application by using the system clock indirectly. That meant that they could substitute a different clock that allows the date and time to be changed by the tests.

34.1 Introduction

Emily and Neo worked together to implement the fixtures for the tests in Chapter 15.

Those tests assume that the clock and time can be changed. “However,” stressed Neo, “it would be a big mistake to try and fiddle with the real system clock.”

“Yes, I agree,” replied Emily, “so let’s use a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required