public void cannotChangeCodeForLockedDoor() { //throws CannotChangeCodeForUnlockedDoor { ThirdPartyDoor door = createThirtPartyDoor(); //Do not unlock it door.setNewLockCode("123"); }
public void changeCode() { //throws CannotUnlockDoorException, CannotChangeCodeForUnlockedDoor { ThirdPartyDoor door = createThirtPartyDoor(); door.unlock(getThirdPartyDoorCode()); door.setNewLockCode("Some Code"); //Lock it door.Locker(); //Try to unlock it door.unlock("Some Code"); }