10.2. Expected Errors with DoFixtureWith DoFixture, we can test directly whether an action has failed, as expected. For example, the tables reported in Figure 10.2 test that a room cannot be removed if somone is in it. In the fourth table, we check that the remove action does not succeed, by using the special action reject or, alternatively, not when it reads better, followed by the action concerned. Figure 10.2. TestCloseRoomFails
Further capabilities of DoFixture are introduced in later chapters. Programmers The fixture code for the tests here is given in Section 28.2 on p. 231. |