test anfang
parent
4f23988517
commit
9ec9925586
|
|
@ -7,5 +7,37 @@
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="JUnit5.8.1">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.8.1/junit-jupiter-5.8.1.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.8.1/junit-platform-commons-1.8.1.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar!/" />
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="JUnit5.8.1">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/../lib/junit-jupiter-5.8.1.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/../lib/junit-jupiter-api-5.8.1.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/../lib/opentest4j-1.2.0.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/../lib/junit-platform-commons-1.8.1.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/../lib/apiguardian-api-1.1.2.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/../lib/junit-jupiter-params-5.8.1.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/../lib/junit-jupiter-engine-5.8.1.jar!/" />
|
||||||
|
<root url="jar://$MODULE_DIR$/../lib/junit-platform-engine-1.8.1.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
public class Hand {
|
public class Hand {
|
||||||
|
|
||||||
private Card[] current_hand = new Card[11];
|
public Card[] current_hand = new Card[11];
|
||||||
private int current_points;
|
private int current_points;
|
||||||
CardStack cs;
|
CardStack cs;
|
||||||
public int old_hand_counter;
|
public int old_hand_counter;
|
||||||
|
|
@ -47,7 +47,6 @@ public class Hand {
|
||||||
|
|
||||||
public void draw_card() {
|
public void draw_card() {
|
||||||
Card drawn_card = cs.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;
|
current_hand[(cs.card_draw_counter - old_hand_counter) - 1] = drawn_card;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,22 @@
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
class HandTest {
|
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]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue