|
@@ -0,0 +1,40 @@
|
|
1
|
+package io.zipcoder.casino;
|
|
2
|
+
|
|
3
|
+import org.junit.Assert;
|
|
4
|
+import org.junit.Before;
|
|
5
|
+import org.junit.Test;
|
|
6
|
+
|
|
7
|
+public class DiceTest {
|
|
8
|
+
|
|
9
|
+ @Test
|
|
10
|
+ public void getSum1(){
|
|
11
|
+ Dice dice = new Dice(2);
|
|
12
|
+ int expected = 6;
|
|
13
|
+ int actual = dice.getSum();
|
|
14
|
+ Assert.assertEquals(expected, actual, 6);
|
|
15
|
+ }
|
|
16
|
+
|
|
17
|
+ @Test
|
|
18
|
+ public void getSum2(){
|
|
19
|
+ Dice dice = new Dice(5);
|
|
20
|
+ int expected = 13;
|
|
21
|
+ int actual = dice.getSum();
|
|
22
|
+ Assert.assertEquals(expected, actual, 12);
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+ @Test
|
|
26
|
+ public void getEach1(){
|
|
27
|
+ Dice dice = new Dice(2);
|
|
28
|
+ int expected = 3;
|
|
29
|
+ int actual = dice.getEach()[1];
|
|
30
|
+ Assert.assertEquals(expected, actual, 3);
|
|
31
|
+ }
|
|
32
|
+
|
|
33
|
+ @Test
|
|
34
|
+ public void getEach2(){
|
|
35
|
+ Dice dice = new Dice(6);
|
|
36
|
+ int expected = 3;
|
|
37
|
+ int actual = dice.getEach()[3];
|
|
38
|
+ Assert.assertEquals(expected, actual, 3);
|
|
39
|
+ }
|
|
40
|
+}
|