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.Matchers.*;
|
||||
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.when;
|
||||
|
||||
public class MinerTest {
|
||||
private Player defaultPlayer() {return new Player("John"); }
|
||||
@@ -41,7 +43,8 @@ public class MinerTest {
|
||||
}
|
||||
@Test
|
||||
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());
|
||||
Biome.COAST.getLootTable().setRandomProvider(random);
|
||||
job.dig(Biome.COAST);
|
||||
@@ -51,7 +54,8 @@ public class MinerTest {
|
||||
|
||||
@Test
|
||||
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());
|
||||
Biome.MOUNTAIN.getLootTable().setRandomProvider(random);
|
||||
job.dig(Biome.MOUNTAIN);
|
||||
|
||||
Reference in New Issue
Block a user