예제 #1
0
        public Message Open(string door)
        {
            if (!_startingZone.DoesDoorExist(door))
            {
                return(new Message("There's no door"));
            }

            var doorIsUnlocked = _startingZone.IsDoorUnlocked(door);

            if (doorIsUnlocked)
            {
                return(Go(_startingZone.GetDoorDirection(door)));
            }

            return(new Message("There's no door"));
        }
예제 #2
0
 public void TellTheUserTheDoorDoesNotExists()
 {
     _zoneConfig = ZoneBuilder.Build("StartingZone");
     Assert.False(_zoneConfig.DoesDoorExist("Red Door"));
 }
예제 #3
0
 public void TellTheUserTheDoorExists()
 {
     _zoneConfig = ZoneBuilder.Build("StartingZone");
     Assert.True(_zoneConfig.DoesDoorExist("White Door"));
 }