Explorar el Código

More negligable things

Kris Blassingame hace 6 años
padre
commit
e74d2925f5

+ 3
- 0
src/main/java/io/zipcoder/casino/Leviathan/Games/GameUtilities/Deck.java Ver fichero

@@ -26,5 +26,8 @@ public class Deck {
26 26
         return deck.remove(deck.size() - 1);
27 27
     }
28 28
 
29
+    public int size() {
30
+        return deck.size();
31
+    }
29 32
 }
30 33
 

+ 6
- 8
src/test/java/io/zipcoder/casino/DeckTest.java Ver fichero

@@ -14,8 +14,6 @@ public class DeckTest {
14 14
     /**
15 15
      * The test class DieTest.
16 16
      */
17
-
18
-    private Card card;
19 17
     private Deck deck;
20 18
 
21 19
     /**
@@ -40,7 +38,7 @@ public class DeckTest {
40 38
 
41 39
 
42 40
         //When
43
-        Object card = deck.draw();
41
+        Card card = deck.draw();
44 42
         Card ten = new Card(Rank.TEN, Suit.SPADES);
45 43
         //Result
46 44
 
@@ -49,14 +47,14 @@ public class DeckTest {
49 47
     }
50 48
 
51 49
     @Test
52
-    public void removeTest() {
53
-
50
+    public void removalTest() {
54 51
 
52
+        Deck deck = new Deck();
55 53
         //When
56
-
54
+        Card result = deck.draw();
57 55
         //Result
58
-
59
-
56
+        int cardsRemaining = deck.size();
57
+        assertEquals(result, cardsRemaining);
60 58
 
61 59
 
62 60
     }