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

            //Do not unlock it
            door.setState(ThirdPartyDoor.DoorState.OPEN);
        }
示例#2
0
        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());
        }