|
@@ -0,0 +1,57 @@
|
|
1
|
+package io.zipcoder.casino;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+import org.junit.jupiter.api.Test;
|
|
5
|
+import sun.jvm.hotspot.utilities.Assert;
|
|
6
|
+
|
|
7
|
+public class SlotTest {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+ @Test
|
|
11
|
+ public void testSlotResult1(){
|
|
12
|
+ int betAmount=10;
|
|
13
|
+ String word1="MOUSE";
|
|
14
|
+ String word2="MOUSE";
|
|
15
|
+ String word3="MOUSE";
|
|
16
|
+ //given
|
|
17
|
+ SlotMachine slotmachine = new SlotMachine(betAmount);
|
|
18
|
+
|
|
19
|
+ slotmachine.slotResult();
|
|
20
|
+ int payout=slotmachine.payout;
|
|
21
|
+ Assert.assertEquals(30,payout);
|
|
22
|
+ }
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+ @Test
|
|
26
|
+ public void testSlotResult2(){
|
|
27
|
+ int betAmount=10;
|
|
28
|
+ String word1="MOUSE";
|
|
29
|
+ String word2="MOUSE";
|
|
30
|
+ String word3="CAT";
|
|
31
|
+ //given
|
|
32
|
+ SlotMachine slotmachine = new SlotMachine(betAmount);
|
|
33
|
+
|
|
34
|
+ slotmachine.slotResult();
|
|
35
|
+ int payout=slotmachine.payout;
|
|
36
|
+ Assert.assertEquals(20,payout);
|
|
37
|
+
|
|
38
|
+ }
|
|
39
|
+
|
|
40
|
+ @Test
|
|
41
|
+ public void testSlotResult3(){
|
|
42
|
+ int betAmount=10;
|
|
43
|
+ String word1="MOUSE";
|
|
44
|
+ String word2="RABBIT";
|
|
45
|
+ String word3="CAT";
|
|
46
|
+ //given
|
|
47
|
+ SlotMachine slotmachine = new SlotMachine(betAmount);
|
|
48
|
+
|
|
49
|
+ slotmachine.slotResult();
|
|
50
|
+ int payout=slotmachine.payout;
|
|
51
|
+ Assert.assertEquals(0,payout);
|
|
52
|
+
|
|
53
|
+ }
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+}
|