Akeem Cherry преди 6 години
родител
ревизия
0bf36c234d

+ 0
- 10
src/main/java/io/zipcoder/casino/BlackjackPlayer.java Целия файл

@@ -1,10 +0,0 @@
1
-package io.zipcoder.casino;
2
-
3
-public class BlackjackPlayer extends Player{
4
-
5
-
6
-    public BlackjackPlayer(String name, double moneyStartedWith) {
7
-
8
-        super(name, moneyStartedWith);
9
-    }
10
-}

+ 0
- 41
src/main/java/io/zipcoder/casino/Hand.java Целия файл

@@ -1,41 +0,0 @@
1
-package io.zipcoder.casino;
2
-
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-
6
-public class Hand {
7
-    private  List<Card> cards = new ArrayList<Card>();
8
-
9
-    public void clear(){
10
-        cards.clear();
11
-    }
12
-
13
-    public void add(Card c){
14
-        if(cards == null)
15
-            throw new NullPointerException ("no cards in hand, add new card");
16
-            cards.add(c);
17
-    }
18
-
19
-
20
-    public Integer getValue(){
21
-       Integer sum = 0;
22
-       for(Card card: cards){
23
-        sum+= card.getValue();
24
-       }
25
-        return sum;
26
-    }
27
-
28
-
29
-    public List<Card> getCards() {
30
-        return cards;
31
-    }
32
-
33
-    public void setCards(List<Card> cards) {
34
-
35
-        this.cards = cards;
36
-    }
37
-
38
-    public boolean contains(Card card){
39
-        return this.cards.contains(card);
40
-    }
41
-}

+ 0
- 26
src/test/java/io/zipcoder/casino/BlackjackDealerTest.java Целия файл

@@ -1,26 +0,0 @@
1
-package io.zipcoder.casino;
2
-
3
-import org.junit.Test;
4
-
5
-public class BlackjackDealerTest {
6
-
7
-    @Test
8
-    public void testDealCard(){
9
-        //Given
10
-
11
-        //When
12
-
13
-        //Then
14
-
15
-    }
16
-
17
-    @Test
18
-    public void testTakeBet(){
19
-        //given
20
-        Player play = new Player();
21
-
22
-        //When
23
-
24
-        //Then
25
-    }
26
-}

+ 0
- 76
src/test/java/io/zipcoder/casino/HandTest.java Целия файл

@@ -1,76 +0,0 @@
1
-package io.zipcoder.casino;
2
-
3
-import org.junit.Assert;
4
-import org.junit.Test;
5
-
6
-import java.util.ArrayList;
7
-import java.util.List;
8
-
9
-public class HandTest {
10
-
11
-    @Test
12
-    public void testAdd(){
13
-
14
-        //Given
15
-        Card expected = new Card(Suit.Diamond, Rank.Ace);
16
-        Hand hand = new Hand();
17
-
18
-        //When
19
-        hand.add(expected);
20
-        //Then
21
-        Assert.assertTrue(hand.contains(expected));
22
-    }
23
-
24
-    @Test
25
-    public void testGetValue(){
26
-
27
-        //Given
28
-        Card card1 = new Card(Suit.Diamond, Rank.Ace);
29
-        Card card2 = new Card(Suit.Spade, Rank.King);
30
-        Hand hand = new Hand();
31
-        hand.add(card1);
32
-        hand.add(card2);
33
-        Integer expectedValue = 11;
34
-
35
-        //when
36
-        Integer actual = hand.getValue();
37
-        //then
38
-        Assert.assertEquals(expectedValue, actual);
39
-    }
40
-
41
-    @Test
42
-    public void testGetCards(){
43
-    //Given
44
-        Hand hand= new Hand();
45
-        Card card1 = new Card(Suit.Diamond, Rank.Ace);
46
-        Card card2 = new Card(Suit.Spade, Rank.King);
47
-        hand.add(card1);
48
-        hand.add(card2);
49
-
50
-        //When
51
-        List<Card> s = hand.getCards();
52
-
53
-        Assert.assertNotNull(s);
54
-        Assert.assertTrue(s.size() == 2);
55
-
56
-
57
-
58
-
59
-    }
60
-
61
-    @Test
62
-    public void testContains(){
63
-        //Given
64
-        Hand hand = new Hand();
65
-        Card card1 = new Card(Suit.Diamond, Rank.Ace);
66
-        hand.add(card1);
67
-
68
-        //When
69
-        Boolean b = hand.contains(card1);
70
-
71
-        //Then
72
-        Assert.assertTrue(b);
73
-    }
74
-
75
-
76
-}