Browse Source

Merge branch 'working' of sambhutani/ZCW-OOP-Casino into working

jonathan-hinds 6 years ago
parent
commit
118feb5d22

+ 6
- 0
src/.idea/misc.xml View File

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="JavaScriptSettings">
4
+    <option name="languageLevel" value="ES6" />
5
+  </component>
6
+</project>

+ 8
- 0
src/.idea/modules.xml View File

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/src.iml" filepath="$PROJECT_DIR$/.idea/src.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
src/.idea/vcs.xml View File

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+  </component>
6
+</project>

+ 24
- 0
src/.idea/workspace.xml View File

@@ -0,0 +1,24 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="PropertiesComponent">
4
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
5
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
6
+    <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
7
+  </component>
8
+  <component name="masterDetails">
9
+    <states>
10
+      <state key="ProjectJDKs.UI">
11
+        <settings>
12
+          <last-edited>1.8</last-edited>
13
+          <splitter-proportions>
14
+            <option name="proportions">
15
+              <list>
16
+                <option value="0.2" />
17
+              </list>
18
+            </option>
19
+          </splitter-proportions>
20
+        </settings>
21
+      </state>
22
+    </states>
23
+  </component>
24
+</project>

+ 2
- 0
src/test/java/io/zipcoder/casino/CardTest.java View File

@@ -2,6 +2,8 @@ package io.zipcoder.casino;
2 2
 
3 3
 import org.junit.Test;
4 4
 
5
+import javax.smartcardio.Card;
6
+
5 7
 public class CardTest {
6 8
 
7 9
     @Test

+ 57
- 0
src/test/java/io/zipcoder/casino/SlotTest.java View File

@@ -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
+}