public void GiveThePlayerNothingWhenTheItemDoesNotExist() { _zoneConfig = ZoneBuilder.Build("Truman Brewery Hall 1"); var item = _zoneConfig.GetItem("Blue Key"); Assert.Null(item); }
public IZoneConfiguration GetNextZone(IZoneConfiguration currentZone, Direction direction) { if (currentZone.GetZoneName() == "StartingZone" && direction == Direction.N) { return(ZoneBuilder.Build("Truman Brewery Hall 1")); } if (currentZone.GetZoneName() == "Truman Brewery Hall 1" && direction == Direction.S) { return(ZoneBuilder.Build("StartingZone")); } if (currentZone.GetZoneName() == "Truman Brewery Hall 1" && direction == Direction.E) { return(ZoneBuilder.Build("Truman Brewery Hall 2")); } if (currentZone.GetZoneName() == "Truman Brewery Hall 2" && direction == Direction.W) { return(ZoneBuilder.Build("Truman Brewery Hall 1")); } if (currentZone.GetZoneName() == "Truman Brewery Hall 2" && direction == Direction.N) { return(ZoneBuilder.Build("Truman Brewery Warehouse")); } throw new NotImplementedException(); }
public void TellThePlayerTheDoorDirectionIsUnknownWhenTheDoorDoesNotExist() { _zoneConfig = ZoneBuilder.Build("StartingZone"); var doorDirection = _zoneConfig.GetDoorDirection("Blue Door"); Assert.Equal(Direction.Unknown, doorDirection); }
public void GiveThePlayerTheItemItRequested() { _zoneConfig = ZoneBuilder.Build("Truman Brewery Hall 1"); var item = _zoneConfig.GetItem("White Key"); Assert.Equal("White Key", item.GetName()); }
public void TellThePlayerTheresAWhiteDoorNorthOfTheStartingZone() { _zoneConfig = ZoneBuilder.Build("StartingZone"); var message = _zoneConfig.LookAtDirection(Direction.N); Assert.Equal("I CAN SEE A BRICK BUILDING WITH A SIGN SAYING \"TRUMAN BREWERY\" AND A WOODEN WHITE DOOR", message.ToString()); }
public void TellThePlayerWhereTheDoorIsLocated() { _zoneConfig = ZoneBuilder.Build("StartingZone"); var doorDirection = _zoneConfig.GetDoorDirection("White Door"); Assert.Equal(Direction.N, doorDirection); }
public void TellThePlayerTheDescriptionOfWhateverIsSouth() { _zoneConfig = ZoneBuilder.Build("StartingZone"); var message = _zoneConfig.LookAtDirection(Direction.S); Assert.Equal("Nothing interesting to look at there!", message.ToString()); }
public void TellThePlayerTheDescriptionOfTheZone() { _zoneConfig = ZoneBuilder.Build("StartingZone"); var message = _zoneConfig.LookAtDirection(); Assert.Equal("LOST IN SHOREDITCH.\r\nYOU ARE STANDING AT THE END OF BRICK LANE BEFORE A SMALL BRICK BUILDING CALLED THE OLD TRUMAN BREWERY. \r\nAROUND YOU IS A FOREST OF INDIAN RESTAURANTS. \r\nA SMALL STREAM OF CRAFTED BEER FLOWS OUT OF THE BUILDING AND DOWN A GULLY.", message.ToString()); }
public Message Go(Direction direction) { _startingZone = _zoneSwitcher.GetNextZone(_startingZone, direction); return(ZoneOverview()); }
public StartingPlayer(IZoneConfiguration startingZone, IZoneSwitcher zoneSwitcher) { _startingZone = startingZone; _zoneSwitcher = zoneSwitcher; }
public void TellTheUserTheDoorDoesNotExists() { _zoneConfig = ZoneBuilder.Build("StartingZone"); Assert.False(_zoneConfig.DoesDoorExist("Red Door")); }
public void TellTheUserTheDoorExists() { _zoneConfig = ZoneBuilder.Build("StartingZone"); Assert.True(_zoneConfig.DoesDoorExist("White Door")); }
public void TellTheUserTheDoorIsOpenWhenTheWhiteDoorIsUnlocked() { _zoneConfig = ZoneBuilder.Build("StartingZone"); Assert.True(_zoneConfig.IsDoorUnlocked("White Door")); }