10.3. Actions on Domain Objects with DoFixtureAs we've seen, the chat application has users and rooms, or what are called the domain objects of this system. Actions are carried out on those objects, such as when a user enters a room, as in the fourth table of Figure 10.1. A DoFixture table may carry out a sequence of actions on a particular domain object that is selected from the system under test.[1] For example, the second table in Figure 10.3 includes an alternative approach to the user connecting, creating a room, and entering it. Rather than including the user name in each action, we have the first row, the connect action, provide access to the user, using another DoFixture. The rest of the rows of that table contain actions that apply to that user.
Figure 10.3. TestUser
The third table in Figure 10.3 acts on the room that is selected in the first row. The second row of that table checks the owner of the roomthe user who created itand the third row action renames the room. In general, if a row selects an object through a DoFixture, the actions in the rest of the table apply to that object. This is similar to the way that RowFixture treats the remaining rows of the table as expected elements. Questions & Answers
|