21.3. Selecting a Phone NumberThe 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.
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.javapublic class CalculateFirstPhoneNumber extends fit.ColumnFixture { private Client client = new Client(); public String[] phones; public String first() { client.setPhones(phones); return client.firstPhone(); } } |