public void cannotOpenLockedDoor() { //throws CannotChangeStateOfLockedDoor { ThirdPartyDoor door = createThirtPartyDoor(); //Do not unlock it door.setState(ThirdPartyDoor.DoorState.OPEN); }
public void openDoor() { //throws CannotUnlockDoorException, CannotChangeStateOfLockedDoor { ThirdPartyDoor door = createThirtPartyDoor(); //Unlock it door.unlock(getThirdPartyDoorCode()); //Now open it door.setState(ThirdPartyDoor.DoorState.OPEN); Assert.AreEqual(ThirdPartyDoor.DoorState.OPEN, door.getState()); }