-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathDiceTest.java
More file actions
35 lines (28 loc) · 917 Bytes
/
DiceTest.java
File metadata and controls
35 lines (28 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import org.junit.Test;
import java.util.Arrays;
public class DiceTest {
@Test
public void diceTest(){
//given
Dice newDices = new Dice(10);
//when
Integer[] dices = newDices.getDiceList().toArray(new Integer[0]);
//then
System.out.println(Arrays.toString(dices));
}
@Test
public void tossAndSumTest(){
//given
Dice newDices = new Dice(10);
Integer[] preToss = newDices.getDiceList().toArray(new Integer[0]);
//when
Integer toss = newDices.tossAndSum();
Integer[] postToss = newDices.getDiceList().toArray(new Integer[0]);
//then
//Check with output
System.out.println(Arrays.toString(preToss));
System.out.println("================After Tossing================");
System.out.println(Arrays.toString(postToss));
System.out.println(toss);
}
}