Section 9.2. Expected Errors with Actions


9.2. Expected Errors with Actions

Errors may also arise in testing actions, as a supplied data value may be invalid. With ActionFixture, we can check for such errors in two ways. In Figure 9.5, we check the occupant count of a room that has not been created and expect an error.

Figure 9.5. Use of error in ActionFixture

fit.ActionFixture

start

ChatServerActions2

enter

room

lotr

check

occupant count

error


In Figure 9.6, a user cannot enter a room that has not been created. So we check that room entered is no to see that the enter room action was unsuccessful, as expected.

Figure 9.6. Checking the Result after an Action in ActionFixture

fit.ActionFixture

start

ChatServerActions2

enter

user

anna

press

connect

enter

room

lotr

press

enter room

check

room entered

no




    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