Write a Concrete Example You Can Check by Hand
Scenario
Room A is free at 14:00. Sam asks to book Room A at 14:00.
- 1Write down the request
- 2Check that exact slot in the schedule
- 3Write down the expected result
Try it yourself
Predict the result before stepping through the example.
- Write down the request
- Check that exact slot in the schedule
- Write down the expected result
Reveal the explanation
- Write down the request
Room A at 14:00.
- Check that exact slot in the schedule
Room A at 14:00 is free.
- Write down the expected result
Accept the booking.
Now repeat the same example with Room A marked occupied. Only the room status changes, so the expected decision must flip to Declined.
Your turn
Write a request for the same slot once when it is free and once when occupied.
Common mistake Leaving out the initial schedule state.
Check your work
Two input–result pairs differ only in slot availability and have opposite decisions.
This browser could not save your progress. Changes last until you leave the page.