Xcuello vor 6 Jahren
Ursprung
Commit
2cd9e293df

+ 17
- 1
src/main/java/io/zipcoder/casino/BlackjackPlayer.java Datei anzeigen

@@ -4,10 +4,26 @@ public class BlackjackPlayer {
4 4
 
5 5
     private double wager;
6 6
 
7
-    public void setBet (double money) {
7
+    private double money;
8
+
9
+    public double setBet(double money) {
8 10
 
9 11
         this.wager = money;
10 12
 
13
+        return money;
14
+    }
15
+
16
+    public double getBet(double money) {
17
+
18
+        this.wager = money;
19
+
20
+        return money;
21
+
22
+    }
23
+    
24
+    public void blackjackPlayer(double money) {
25
+
26
+        
11 27
 
12 28
     }
13 29
 }

+ 33
- 0
src/test/java/blackjackPlayerTest.java Datei anzeigen

@@ -1,7 +1,40 @@
1
+import io.zipcoder.casino.BlackjackPlayer;
2
+import org.junit.Assert;
1 3
 import org.junit.Test;
2 4
 
3 5
 public class blackjackPlayerTest {
4 6
 
7
+    @Test
5 8
 
9
+    public void setBet() {
6 10
 
11
+        //Given
12
+        BlackjackPlayer blackjackPlayer = new BlackjackPlayer();
13
+
14
+        //When
15
+        double expected = 100.00;
16
+
17
+        double actual = blackjackPlayer.setBet(100.00);
18
+
19
+        //Then
20
+        Assert.assertEquals(expected,actual, 0);
21
+
22
+    }
23
+
24
+    @Test
25
+
26
+    public void getBet() {
27
+
28
+        //Given
29
+        BlackjackPlayer blackjackPlayer = new BlackjackPlayer();
30
+
31
+        //When
32
+        double actual = 100.00;
33
+
34
+        double expected = blackjackPlayer.getBet(100.00);
35
+
36
+        //Then
37
+        Assert.assertEquals(expected,actual,0);
38
+
39
+    }
7 40
 }

+ 18
- 0
src/test/java/playerTest.java Datei anzeigen

@@ -1,4 +1,22 @@
1
+import io.zipcoder.casino.Hand;
2
+import io.zipcoder.casino.Player;
1 3
 import org.junit.Test;
2 4
 
3 5
 public class playerTest {
6
+
7
+    @Test
8
+
9
+    public void addCard() {
10
+
11
+        //Given
12
+        Player player = new Player();
13
+
14
+        //When
15
+
16
+
17
+        //Then
18
+
19
+
20
+
21
+    }
4 22
 }