inventory #14
@@ -33,4 +33,5 @@ public class InventoryTest {
|
|||||||
)
|
)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ import org.junit.jupiter.api.Test;
|
|||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class MinerTest {
|
public class MinerTest {
|
||||||
private Player defaultPlayer() {return new Player("John"); }
|
private Player defaultPlayer() {return new Player("John"); }
|
||||||
@@ -41,7 +43,8 @@ public class MinerTest {
|
|||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
void dig_in_coast_use_coast_loot() {
|
void dig_in_coast_use_coast_loot() {
|
||||||
RandomProvider random = bound -> 9;
|
RandomProvider random = mock(RandomProvider.class);
|
||||||
|
when(random.nextInt(anyInt())).thenReturn(9);
|
||||||
var job = new Miner(defaultPlayer());
|
var job = new Miner(defaultPlayer());
|
||||||
Biome.COAST.getLootTable().setRandomProvider(random);
|
Biome.COAST.getLootTable().setRandomProvider(random);
|
||||||
job.dig(Biome.COAST);
|
job.dig(Biome.COAST);
|
||||||
@@ -51,7 +54,8 @@ public class MinerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void dig_in_mountain_use_mountain_loot() {
|
void dig_in_mountain_use_mountain_loot() {
|
||||||
RandomProvider random = bound -> 15;
|
RandomProvider random = mock(RandomProvider.class);
|
||||||
|
when(random.nextInt(anyInt())).thenReturn(15);
|
||||||
var job = new Miner(defaultPlayer());
|
var job = new Miner(defaultPlayer());
|
||||||
Biome.MOUNTAIN.getLootTable().setRandomProvider(random);
|
Biome.MOUNTAIN.getLootTable().setRandomProvider(random);
|
||||||
job.dig(Biome.MOUNTAIN);
|
job.dig(Biome.MOUNTAIN);
|
||||||
|
|||||||
Reference in New Issue
Block a user