Browse Source

completed casino project

Jonathan Hinds 6 years ago
parent
commit
c8795189bd

+ 1
- 2
src/test/java/io/zipcoder/casino/CasinoTest.java View File

68
         String input = "3 \n 2 \n Nick \n 1000 \n";
68
         String input = "3 \n 2 \n Nick \n 1000 \n";
69
         String studInput = "flip \n flip \n flip";
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
         ((Stud)studGame).setScanner(new Scanner(new ByteArrayInputStream(studInput.getBytes())));
72
         ((Stud)studGame).setScanner(new Scanner(new ByteArrayInputStream(studInput.getBytes())));
74
         try {
73
         try {
75
             casino.chooseGame();
74
             casino.chooseGame();

+ 0
- 23
src/test/java/io/zipcoder/casino/ConsoleTest.java View File

9
 
9
 
10
 public class ConsoleTest {
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 View File

5
 
5
 
6
 public class DeckTest {
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
     @Test
20
     @Test
21
     public void pullCard(){
21
     public void pullCard(){

+ 0
- 1
src/test/java/io/zipcoder/casino/WarTest.java View File

83
 
83
 
84
         String input = "flip \n";
84
         String input = "flip \n";
85
 
85
 
86
-
87
             war.setScanner(new Scanner(new ByteArrayInputStream(input.getBytes())));
86
             war.setScanner(new Scanner(new ByteArrayInputStream(input.getBytes())));
88
             try {
87
             try {
89
                 war.startGame();
88
                 war.startGame();