monster #20
@@ -2,11 +2,14 @@
|
||||
public class Tile {
|
||||
private String tileName;
|
||||
private int staminaCost;
|
||||
private String tilePrintString;
|
||||
public Tile(String tileName, int staminaCost, String tilePrintString) {
|
||||
private String tileID;
|
||||
public Tile(String tileName, int staminaCost, String tileID) {
|
||||
this.tileName = tileName;
|
||||
this.staminaCost = staminaCost;
|
||||
this.tilePrintString = tilePrintString;
|
||||
this.tileID = tileID;
|
||||
}
|
||||
public void setStaminaCost(int newStaminaCost) {
|
||||
staminaCost = newStaminaCost;
|
||||
}
|
||||
public String getName() {
|
||||
return tileName;
|
||||
@@ -14,7 +17,7 @@ public class Tile {
|
||||
public int getStaminaCost() {
|
||||
return staminaCost;
|
||||
}
|
||||
public String getTilePrintString() {
|
||||
return tilePrintString;
|
||||
public String getTileID() {
|
||||
return tileID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,21 +7,28 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
class TileTest {
|
||||
private final String TILE_NAME = "Name test";
|
||||
private final int STAMINA_COST = 1;
|
||||
private final String PRINT_STRING = "Mountain test";
|
||||
private final String ID_STRING = "Mountain test";
|
||||
@Test
|
||||
void getTileNameTest() {
|
||||
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, PRINT_STRING);
|
||||
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, ID_STRING);
|
||||
String tileNameTwo = tileTest.getName();
|
||||
assertEquals(TILE_NAME, tileNameTwo);
|
||||
}
|
||||
@Test
|
||||
void getStaminaCostTest() {
|
||||
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, PRINT_STRING);
|
||||
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, ID_STRING);
|
||||
assertEquals(STAMINA_COST, tileTest.getStaminaCost());
|
||||
}
|
||||
@Test
|
||||
void printTileStringTest() {
|
||||
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, PRINT_STRING);
|
||||
assertEquals(PRINT_STRING, tileTest.getTilePrintString());
|
||||
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, ID_STRING);
|
||||
assertEquals(ID_STRING, tileTest.getTileID());
|
||||
}
|
||||
@Test
|
||||
void setStaminaCostTest() {
|
||||
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, ID_STRING);
|
||||
tileTest.setStaminaCost(10);
|
||||
int newStaminaCost = tileTest.getStaminaCost();
|
||||
assertEquals(10, newStaminaCost);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user