diff --git a/Test/Test.iml b/Test/Test.iml index c90834f..58c5c5c 100644 --- a/Test/Test.iml +++ b/Test/Test.iml @@ -7,5 +7,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Test/src/Hand.java b/Test/src/Hand.java index 3929243..0f91cad 100644 --- a/Test/src/Hand.java +++ b/Test/src/Hand.java @@ -1,6 +1,6 @@ public class Hand { - private Card[] current_hand = new Card[11]; + public Card[] current_hand = new Card[11]; private int current_points; CardStack cs; public int old_hand_counter; @@ -47,7 +47,6 @@ public class Hand { public void draw_card() { Card drawn_card = cs.draw_card(); - System.out.println("die karte ist " + drawn_card.card_value); current_hand[(cs.card_draw_counter - old_hand_counter) - 1] = drawn_card; diff --git a/Test/src/HandTest.java b/Test/src/HandTest.java index e4e52f5..83883a7 100644 --- a/Test/src/HandTest.java +++ b/Test/src/HandTest.java @@ -1,5 +1,22 @@ +import org.junit.jupiter.api.Test; + import static org.junit.jupiter.api.Assertions.*; class HandTest { + CardStack cs = new CardStack(); + Hand hand = new Hand(cs); + @Test + void get_points_test() { + assertEquals(hand.current_hand[0].get_points(hand.current_hand[0]) + + hand.current_hand[1].get_points(hand.current_hand[1]), + hand.get_points()); + + } + + @Test + void draw_card_test() { + hand.draw_card(); + assertNotNull(hand.current_hand[2]); + } } \ No newline at end of file