import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; public class DiceTest { @Before public void setUp() { } @Test public void rollDiceTest(){ Dice dice = new Dice(); Integer given = dice.roll(); Integer min = 1; Integer max = 6; assertTrue(min <= given && given <= max ); } @Test public void rollTwoDiceTest(){ Dice dice = new Dice(2); Integer expected = 6; Integer given = dice.roll(); assertEquals(expected, given, 6); } @Test public void rollTwoDiceTwiceTest(){ Dice dice = new Dice(2); Integer expected = 14; Integer given = dice.roll(2); assertEquals(expected, given, 10); } @Test public void rollThreeDiceTest(){ Dice dice = new Dice(3); Integer expected = 10; Integer given = dice.roll(); assertEquals(expected, given, 7.5); } @Test public void rollThreeDiceTwiceTest(){ Dice dice = new Dice(3); Integer expected = 21; Integer given = dice.roll(2); assertEquals(expected, given, 15); } }