forked from pspeasegood/TGJCO-Apr2024
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DiceRollTest.java
57 lines (49 loc) · 1.75 KB
/
DiceRollTest.java
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class DiceRollTest {
@Test
public void testRollWithValidSides2() {
int result = DiceRoll.roll(2);
assertTrue("Result should be between 1 and " + 2, result >= 1 && result <= 2);
}
@Test
public void testRollWithValidSides3() {
int result = DiceRoll.roll(3);
assertTrue("Result should be between 1 and " + 3, result >= 1 && result <= 3);
}
@Test
public void testRollWithValidSides4() {
int result = DiceRoll.roll(4);
assertTrue("Result should be between 1 and " + 4, result >= 1 && result <= 4);
}
@Test
public void testRollWithValidSides6() {
int result = DiceRoll.roll(6);
assertTrue("Result should be between 1 and " + 6, result >= 1 && result <= 6);
}
@Test
public void testRollWithValidSides8() {
int result = DiceRoll.roll(8);
assertTrue("Result should be between 1 and " + 8, result >= 1 && result <= 8);
}
@Test
public void testRollWithValidSides10() {
int result = DiceRoll.roll(10);
assertTrue("Result should be between 1 and " + 10, result >= 1 && result <= 10);
}
@Test
public void testRollWithValidSides12() {
int result = DiceRoll.roll(12);
assertTrue("Result should be between 1 and " + 12, result >= 1 && result <= 12);
}
@Test
public void testRollWithValidSides20() {
int result = DiceRoll.roll(20);
assertTrue("Result should be between 1 and " + 8, result >= 1 && result <= 20);
}
@Test
public void testRollWithValidSides100() {
int result = DiceRoll.roll(100);
assertTrue("Result should be between 1 and " + 100, result >= 1 && result <= 100);
}
}