equipments #22
@@ -2,11 +2,14 @@
|
|||||||
public class Tile {
|
public class Tile {
|
||||||
private String tileName;
|
private String tileName;
|
||||||
private int staminaCost;
|
private int staminaCost;
|
||||||
private String tilePrintString;
|
private String tileID;
|
||||||
public Tile(String tileName, int staminaCost, String tilePrintString) {
|
public Tile(String tileName, int staminaCost, String tileID) {
|
||||||
this.tileName = tileName;
|
this.tileName = tileName;
|
||||||
this.staminaCost = staminaCost;
|
this.staminaCost = staminaCost;
|
||||||
this.tilePrintString = tilePrintString;
|
this.tileID = tileID;
|
||||||
|
}
|
||||||
|
public void setStaminaCost(int newStaminaCost) {
|
||||||
|
staminaCost = newStaminaCost;
|
||||||
}
|
}
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return tileName;
|
return tileName;
|
||||||
@@ -14,7 +17,7 @@ public class Tile {
|
|||||||
public int getStaminaCost() {
|
public int getStaminaCost() {
|
||||||
return staminaCost;
|
return staminaCost;
|
||||||
}
|
}
|
||||||
public String getTilePrintString() {
|
public String getTileID() {
|
||||||
return tilePrintString;
|
return tileID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,21 +7,28 @@ import static org.junit.jupiter.api.Assertions.*;
|
|||||||
class TileTest {
|
class TileTest {
|
||||||
private final String TILE_NAME = "Name test";
|
private final String TILE_NAME = "Name test";
|
||||||
private final int STAMINA_COST = 1;
|
private final int STAMINA_COST = 1;
|
||||||
private final String PRINT_STRING = "Mountain test";
|
private final String ID_STRING = "Mountain test";
|
||||||
@Test
|
@Test
|
||||||
void getTileNameTest() {
|
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();
|
String tileNameTwo = tileTest.getName();
|
||||||
assertEquals(TILE_NAME, tileNameTwo);
|
assertEquals(TILE_NAME, tileNameTwo);
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
void getStaminaCostTest() {
|
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());
|
assertEquals(STAMINA_COST, tileTest.getStaminaCost());
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
void printTileStringTest() {
|
void printTileStringTest() {
|
||||||
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, PRINT_STRING);
|
Tile tileTest = new Tile(TILE_NAME, STAMINA_COST, ID_STRING);
|
||||||
assertEquals(PRINT_STRING, tileTest.getTilePrintString());
|
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