Section 21.3. Selecting a Phone Number


21.3. Selecting a Phone Number

The test from Section 3.4 on p. 19 is shown again in Figure 21.4. Our fixture class is CalculateFirstPhoneNumber, a ColumnFixture, as shown in Listing 21.3.

Figure 21.4. Fit Table for Testing First Phone

CalculateFirstPhoneNumber

phones

first()

(209)373 7453, (209)373 7454

(209)373 7453


There is one given column, so the class has a corresponding instance variable, which is an array. There is one calculated column, corresponding to the method first().

Listing 21.3. CalculateFirstPhoneNumber.java
 public class CalculateFirstPhoneNumber extends fit.ColumnFixture {    private Client client = new Client();    public String[] phones;    public String first() {       client.setPhones(phones);       return client.firstPhone();    } } 



    Fit for Developing Software. Framework for Integrated Tests
    Fit for Developing Software: Framework for Integrated Tests
    ISBN: 0321269349
    EAN: 2147483647
    Year: 2005
    Pages: 331

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net