示例#1
0
        public void cannotChangeCodeForLockedDoor()
        {
            //throws CannotChangeCodeForUnlockedDoor {
            ThirdPartyDoor door = createThirtPartyDoor();

            //Do not unlock it
            door.setNewLockCode("123");
        }
示例#2
0
        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");
        }