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 9. Expecting Errors

In this chapter, we show how to use Fit tables to write tests in which errors are expected.

9.1 Expected Errors with Calculations

Sometimes, we want to test that the test data is rejected, as expected. For example, consider Figure 9.1, in which a negative amount is used in the first test row.

Figure 9.1 Negative Amount

Image

When this Fit table is run, we get the report (partly) shown in Figure 9.2, in which the program rejects the negative amount. The report also provides programmer-specific information about the error in the yellow-colored cell (see Plate 5), which we can ignore.

Figure 9.2 Negative Amount Is Rejected ...

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