Section 4.4. Exercises


4.4. Exercises

Answers to selected exercises are available on the book Web site; see Appendix B for details.

1.

The business rule from Section 4.1 on p. 23 is as follows: "A user selects a number of items to buy. The total price is accumulated for those items." Color in Figure 4.9 according to this rule, based on the traffic light colors in Section 3.2 on p. 14. Do so as it would be reported by Fit, according to whether the tests pass. You don't need to bother to insert actual values where a test value is wrong.

Figure 4.9. Color in the Table

fit.ActionFixture

start

BuyActions

check

total

00.00

enter

price

45.00

press

buy

check

total

55.00

enter

price

100.00

press

buy

check

total

145.00

enter

price

100.00

check

total

255.00


2.

Let's write a new test related to the test in Section 4.2 on p. 26: "Anna creates a second room and moves to it." You make the business decision as to whether she is only in the latest room or is in both.

3.

Choose a simple sequence of steps in a business process that is relevant to you, and write a test using an ActionFixture table.



    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