Fit for Developing Software: Framework for Integrated Tests
3.4. Selecting a Phone Number
Our third example illustrates the use of simple lists in tests. The business rule for this example is very simple. The first phone number in the list of supplied phone numbers will normally be used for communicating with the client. A single test is shown in Figure 3.5. The phones column contains a comma-separated list of phone numbers. The calculated column first() selects the first one in the list.
When the elements of a list are more complex, such as containing details of each order item within an order, this approach doesn't work. A RowFixture table can be used instead, as discussed in Chapter 5. Questions & Answers
Programmers The fixture code for the tests here is given in Section 21.3 on p. 184. | ||||||||||||||