Selaa lähdekoodia

completed casino project

Jonathan Hinds 6 vuotta sitten
vanhempi
commit
c8795189bd

+ 1
- 2
src/test/java/io/zipcoder/casino/CasinoTest.java Näytä tiedosto

@@ -68,8 +68,7 @@ public class CasinoTest {
68 68
         String input = "3 \n 2 \n Nick \n 1000 \n";
69 69
         String studInput = "flip \n flip \n flip";
70 70
 
71
-
72
-        casino.getConsole().setScanner(new Scanner(new ByteArrayInputStream(input.getBytes())));
71
+        casino.getConsole().setScanner(new Scanner(input));
73 72
         ((Stud)studGame).setScanner(new Scanner(new ByteArrayInputStream(studInput.getBytes())));
74 73
         try {
75 74
             casino.chooseGame();

+ 0
- 23
src/test/java/io/zipcoder/casino/ConsoleTest.java Näytä tiedosto

@@ -9,29 +9,6 @@ import java.util.*;
9 9
 
10 10
 public class ConsoleTest {
11 11
 
12
-    @Test
13
-    public void testCreateAccont()
14
-    {
15
-        Console console = new Console();
16
-        String name = "Jon \n";
17
-        Integer balance = 100;
18
-        ByteBuffer b = ByteBuffer.allocate(balance);
19
-        byte[] result = b.array();
20 12
 
21 13
 
22
-        byte[] one = result;
23
-        byte[] two = name.getBytes();
24
-        byte[] combined = new byte[one.length + two.length];
25
-
26
-        System.arraycopy(one,0,combined,0,one.length);
27
-        System.arraycopy(two,0,combined,one.length,two.length);
28
-
29
-
30
-        String data = "Jon" + "\nA second line of user input.";
31
-        System.setIn(new ByteArrayInputStream(combined));
32
-
33
-        console.setScanner(new Scanner(new ByteArrayInputStream(combined)));
34
-
35
-    }
36
-
37 14
 }

+ 11
- 11
src/test/java/io/zipcoder/casino/DeckTest.java Näytä tiedosto

@@ -5,17 +5,17 @@ import org.junit.Test;
5 5
 
6 6
 public class DeckTest {
7 7
 
8
-    @Test
9
-    public void testDeck(){
10
-        //GIVEN
11
-        Deck deck = new Deck();
12
-        //WHEN
13
-        for (int i = 0; i < 52; i++){
14
-            System.out.println(deck.getCard(i).getName());
15
-        }
16
-
17
-        //THEN
18
-    }
8
+//    @Test
9
+//    public void testDeck(){
10
+//        //GIVEN
11
+//        Deck deck = new Deck();
12
+//        //WHEN
13
+//        for (int i = 0; i < 52; i++){
14
+//            System.out.println(deck.getCard(i).getName());
15
+//        }
16
+//
17
+//        //THEN
18
+//    }
19 19
 
20 20
     @Test
21 21
     public void pullCard(){

+ 0
- 1
src/test/java/io/zipcoder/casino/WarTest.java Näytä tiedosto

@@ -83,7 +83,6 @@ public class WarTest {
83 83
 
84 84
         String input = "flip \n";
85 85
 
86
-
87 86
             war.setScanner(new Scanner(new ByteArrayInputStream(input.getBytes())));
88 87
             try {
89 88
                 war.startGame();