Fit for Developing Software: Framework for Integrated Tests

28.4. Expected Errors with DoFixture

Consider now the test from Section 10.2 on p. 74, shown again in Figure 28.4. The second row of the fourth table tests that the action to remove a room is rejected.

Figure 28.4. TestCloseRoomFails

The reject special action calls the method removeRoom() in the system under test. The method removeRoom() returns false in this case, as it's not possible to remove a room if users are in it. Hence, the reject succeeds.

    Категории