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 GiveThePlayerTheItemItRequested() { _zoneConfig = ZoneBuilder.Build("Truman Brewery Hall 1"); var item = _zoneConfig.GetItem("White Key"); Assert.Equal("White Key", item.GetName()); }
public void GiveThePlayerNothingWhenTheItemDoesNotExist() { _zoneConfig = ZoneBuilder.Build("Truman Brewery Hall 1"); var item = _zoneConfig.GetItem("Blue Key"); Assert.Null(item); }
public void TellThePlayerWhereTheDoorIsLocated() { _zoneConfig = ZoneBuilder.Build("StartingZone"); var doorDirection = _zoneConfig.GetDoorDirection("White Door"); Assert.Equal(Direction.N, doorDirection); }
public void TellThePlayerTheDoorDirectionIsUnknownWhenTheDoorDoesNotExist() { _zoneConfig = ZoneBuilder.Build("StartingZone"); var doorDirection = _zoneConfig.GetDoorDirection("Blue Door"); Assert.Equal(Direction.Unknown, 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 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 MoveToTheTrumanBreweryFromTheStartingZone() { var zoneSwitcher = new ZoneSwitcher(); var firstZone = ZoneBuilder.Build("StartingZone"); var zone = zoneSwitcher.GetNextZone(firstZone, Direction.N); Assert.Equal("Truman Brewery Hall 1", zone.GetZoneName()); }
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 void MoveToTheTrumanBreweryThenMoveBackToTheStartingZone() { var zoneSwitcher = new ZoneSwitcher(); var firstZone = ZoneBuilder.Build("StartingZone"); var secondZone = zoneSwitcher.GetNextZone(firstZone, Direction.N); var thirdZone = zoneSwitcher.GetNextZone(secondZone, Direction.S); Assert.Equal("StartingZone", thirdZone.GetZoneName()); }
public void PlayerLooksSouthThenLooksNorthOpensDoorPicksUpKeysOpensBagGoesNorthFailsLooksEastGoesEastUseKeyOpenDoor() { var player = new StartingPlayer(ZoneBuilder.Build("StartingZone"), new ZoneSwitcher()); _katacombs = new Katacombs(player); _katacombs.Start(); _katacombs.Action("Look S"); _katacombs.Action("Look N"); _katacombs.Action("Open White Door"); _katacombs.Action("Take Key"); _katacombs.Action("Bag"); _katacombs.Action("Go E"); _katacombs.Action("Use Key"); var message = _katacombs.Action("Open White Door"); Assert.Equal("Inside Truman Brewery's warehouse.\r\nYou're inside a warehouse filled with rows of beer kegs. You smell the putrid odor of death.", message.ToString()); }
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")); }