|
|
@ -0,0 +1,28 @@ |
|
|
|
import static org.assertj.core.api.Assertions.*; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
import org.junit.jupiter.api.DisplayName; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
|
|
import org.junit.jupiter.params.provider.MethodSource; |
|
|
|
|
|
|
|
public class PlayerTest { |
|
|
|
|
|
|
|
private Player p; |
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
void setup() { |
|
|
|
p = new Player(); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void testDice() { |
|
|
|
int calculatedResult = p.rollDice(); |
|
|
|
assertThat(calculatedResult).describedAs("Dice result").isBetween(1,6); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |