public class TestMapModel
extends java.lang.Object
Constructor and Description |
---|
TestMapModel() |
Modifier and Type | Method and Description |
---|---|
void |
setUp() |
void |
tearDown() |
void |
testCanPlaceCity_CityExists()
A city cannot be placed on another city regardless of color.
|
void |
testCanPlaceCity_Invalid()
Attempt to place city on a coordinate that doesn't exist.
|
void |
testCanPlaceCity_NotEstablished()
A city requires a settlement to be placed.
|
void |
testCanPlaceCity_True()
A city can be placed on a settlement of like color.
|
void |
testCanPlacePip_False()
A pip cannot be placed on water.
|
void |
testCanPlacePip_Invalid()
Attempt to place pip on a hex that doesn't exist.
|
void |
testCanPlacePip_True()
Should be allowed to place pip.
|
void |
testCanPlacePip_Uninitialized()
Pips can't be placed until the hexes have been initialized.
|
void |
testCanPlaceRoad_InvalidEdge()
No end points are satisfied.
|
void |
testCanPlaceRoad_RoadExists()
Attempts to place roads on already existed roads.
|
void |
testCanPlaceRoad_RoadSatisfied()
Roads can be added to other roads of like color.
|
void |
testCanPlaceRoad_VillageSatisfied()
Village is used to refer to cities or settlements.
|
void |
testCanPlaceRobber_False()
The robber cannot be placed on water.
|
void |
testCanPlaceRobber_Invalid()
Hexes need to be generated, which is done in the MapGenerator.
|
void |
testCanPlaceRobber_Valid()
Test valid placement of robber.
|
void |
testCanPlaceSettlement_ExistingNeighbor()
A settlement can't be placed when too close to other
villages.
|
void |
testCanPlaceSettlement_InvalidVertex()
Attempts to use a vertex that doesn't exist.
|
void |
testCanPlaceSettlement_VillageExists()
This village can't be placed as a village or city is already in the location.
|
void |
testCanPlaceSettlementInitial_True()
This settlement can be placed as the location is valid an no other pieces
are on the board to restrict it.
|
void |
testContainsEdge_False()
Edges are initialized automatically.
|
void |
testContainsEdge_True()
Tests for an existing edge.
|
void |
testContainsHex_InvalidHex()
This checks a hex that shouldn't exist after initialization.
|
void |
testContainsVertex_False()
Vertices are initialized automatically.
|
void |
testContainsVertex_True()
Tests a valid vertex.
|
void |
testGetEdge_Invalid()
Attempt to get edge that doesn't exist.
|
void |
testGetEdge_Valid()
Valid attempt to get edge.
|
void |
testGetEdges()
Should return all the edges in the map.
|
void |
testGetHex_InvalidHex()
Thrown when trying to access a invalid hex coordinate.
|
void |
testGetHex_Valid()
Valid attempt to get hex.
|
void |
testGetHexes_Initialized()
When fully inititalized, 37 hexes should exist.
|
void |
testGetHexes_Uninitialized()
When uninitialized, a null iterator should be returned.
|
void |
testGetLongestRoad() |
void |
testGetLongestRoadSpecialCase() |
void |
testGetPips()
Test to make sure we get all the pips.
|
void |
testGetPorts()
Tests to make sure we get all the ports.
|
void |
testGetVertex_Invalid()
Attempt to access a vertex that doesn't exist.
|
void |
testGetVertex_Valid()
Should be able to access vertex.
|
void |
testGetVertices()
Should get a list of all vertices.
|
void |
testGetVerticesVertex_Center()
Gets the neighboring vertices.
|
void |
testGetVerticiesHex_Exterior()
Gets the vertices around an exterior hex.
|
void |
testGetVerticiesHex_Interior()
Gets the vertices around an interior hex.
|
void |
testHexExists_Initialized()
Map generator initializes the hexes.
|
void |
testIsRobberInitialized_True()
By running the map generator, the robber should get initialized.
|
void |
testPlaceCity_Invalid()
Attempt to place a city on a non-existent vertex.
|
void |
testPlaceCity_NotEstablished()
Attempt to place a city on a vertex that doesn't contain a settlement.
|
void |
testPlaceCity_Valid()
Valid placement of a city on a matching settlement.
|
void |
testPlaceCity_WrongColor()
Attempt to steal a settlement.
|
void |
testPlaceHex_Overflow()
The map can only store a certain amount of tiles for a valid board.
|
void |
testPlaceHex_Overwrite()
Can't use set hex to overwrite existing hexes.
|
void |
testPlaceHex_Valid()
Successfully adds hex.
|
void |
testPlacePort_DryPort()
Attempts to place port on something other than water.
|
void |
testPlacePort_InvalidVertices()
Uses invalid verticies for the edge.
|
void |
testPlaceRoad_EndNotSatisified()
Attempts to add road when the end condition isn't satisfied.
|
void |
testPlaceRoad_InvalidEdge()
Attempt to add road across hex.
|
void |
testPlaceRoad_RoadExists()
Can't place a road on an existing road.
|
void |
testPlaceRoad_Valid()
Satisfies all conditions to make road.
|
void |
testPlaceRobber_Fail()
Attempts to place robber in water, which is not valid.
|
void |
testPlaceRobber()
Successfully call of placing robber.
|
void |
testPlaceSettlement_ExistingNeighbor()
Settlements can't have neighbors.
|
void |
testPlaceSettlement_InvalidVertex()
Exception should be thrown for a vertex that doesn't exist.
|
void |
testPlaceSettlement_Valid() |
void |
testPlaceSettlement_VillageExists()
Can't place a village on an already occupied vertex.
|
void |
testSetPort_Valid() |
private MapModel model
public void setUp() throws java.lang.Exception
java.lang.Exception
public void tearDown() throws java.lang.Exception
java.lang.Exception
public void testIsRobberInitialized_True()
public void testContainsEdge_False()
public void testContainsEdge_True()
public void testContainsVertex_False()
public void testContainsVertex_True()
public void testHexExists_Initialized()
public void testContainsHex_InvalidHex()
public void testCanPlaceRoad_InvalidEdge()
public void testCanPlaceRoad_RoadExists() throws MapException
MapException
- This shouldn't occur.public void testCanPlaceRoad_VillageSatisfied() throws MapException
MapException
- Shouldn't occur.public void testCanPlaceRoad_RoadSatisfied() throws MapException
MapException
- Shouldn't occurpublic void testCanPlaceSettlement_VillageExists() throws MapException
MapException
- This shouldn't occurpublic void testCanPlaceSettlement_ExistingNeighbor() throws MapException
MapException
- Shouldn't occurpublic void testCanPlaceSettlement_InvalidVertex()
public void testCanPlaceSettlementInitial_True()
public void testCanPlaceCity_CityExists() throws MapException
MapException
- Shouldn't occurpublic void testCanPlaceCity_NotEstablished()
public void testCanPlaceCity_Invalid()
public void testCanPlaceCity_True() throws MapException
MapException
- Shouldn't occurpublic void testCanPlaceRobber_False()
public void testCanPlaceRobber_Invalid()
public void testCanPlaceRobber_Valid()
public void testCanPlacePip_False()
public void testCanPlacePip_Uninitialized()
public void testCanPlacePip_Invalid()
public void testCanPlacePip_True()
public void testPlaceHex_Overwrite() throws MapException
MapException
- Thrown due to attempt to overwrite.public void testPlaceHex_Overflow() throws MapException
MapException
- Thrown because too many tiles are added.public void testPlaceHex_Valid() throws MapException
MapException
- Shouldn't occur.public void testPlaceRoad_InvalidEdge() throws MapException
MapException
- Thrown as the road doesn't exist.public void testPlaceRoad_RoadExists() throws MapException
MapException
- Should be thrown at second road placement attempt.public void testPlaceRoad_EndNotSatisified() throws MapException
MapException
- Thrown when road is placed.public void testPlaceRoad_Valid() throws MapException
MapException
public void testPlaceSettlement_VillageExists() throws MapException
MapException
- Thrown when trying to replace village.public void testPlaceSettlement_ExistingNeighbor() throws MapException
MapException
- Thrown when attempt is made to add neighbor.public void testPlaceSettlement_InvalidVertex() throws MapException
MapException
- Thrown when attempting to place on invalid vertex.public void testPlaceSettlement_Valid() throws MapException
MapException
public void testPlaceCity_Invalid() throws MapException
MapException
- Thrown in attempt to place city.public void testPlaceCity_NotEstablished() throws MapException
MapException
- Thrown when placing city.public void testPlaceCity_WrongColor() throws MapException
MapException
- Thrown when placing city.public void testPlaceCity_Valid() throws MapException
MapException
- Shouldn't be thrown.public void testPlacePort_DryPort() throws MapException
MapException
- Thrown when placing port.public void testPlacePort_InvalidVertices() throws MapException
MapException
- Thrown when placing port.public void testSetPort_Valid() throws MapException
MapException
public void testPlaceRobber_Fail() throws MapException
MapException
- Thrown upon placing robber.public void testPlaceRobber() throws MapException
MapException
- Shouldn't occur.public void testGetHex_InvalidHex() throws MapException
MapException
- Thrown accessing hex.public void testGetHex_Valid() throws MapException
MapException
public void testGetHexes_Uninitialized()
public void testGetHexes_Initialized()
public void testGetEdge_Invalid() throws MapException
MapException
- Thrown when getting edge.public void testGetEdge_Valid() throws MapException
MapException
- Shouldn't occur.public void testGetEdges()
public void testGetVertex_Invalid() throws MapException
MapException
- Thrown when accessing invalid vertex.public void testGetVertex_Valid() throws MapException
MapException
- Shouldn't occur.public void testGetVertices()
public void testGetVerticiesHex_Interior() throws MapException
MapException
- Shouldn't occur.public void testGetVerticiesHex_Exterior() throws MapException
MapException
- Shouldn't occur.public void testGetVerticesVertex_Center() throws MapException
MapException
- Shouldn't occur.public void testGetPorts()
public void testGetPips()
public void testGetLongestRoad() throws MapException
MapException
public void testGetLongestRoadSpecialCase() throws MapException
MapException