29 lines
1.0 KiB
Java
29 lines
1.0 KiB
Java
|
package de.hs_mannheim.informatik.domain;
|
||
|
|
||
|
import org.junit.jupiter.api.Test;
|
||
|
|
||
|
import static org.junit.jupiter.api.Assertions.*;
|
||
|
|
||
|
class HandKarteTest {
|
||
|
|
||
|
@Test
|
||
|
void getPunkte() {
|
||
|
|
||
|
Kartenstapel ks = new Kartenstapel();
|
||
|
Hand handRandom = new Hand(ks);
|
||
|
Hand hand1 = new Hand(new Karte("Pik","Bube"),new Karte("Herz","Ass"));
|
||
|
Hand hand2 = new Hand(new Karte("Karo","Ass"),new Karte("Herz","9"),new Karte("Herz","5"));
|
||
|
Hand hand3 = new Hand(new Karte("Pik","Ass"),new Karte("Herz","Ass"));
|
||
|
Hand hand4 = new Hand(new Karte("Herz","9"),new Karte("Karo","Bube"),new Karte("Pik","Ass"));
|
||
|
Hand hand5 = new Hand(new Karte("Pik","Ass"),new Karte("Herz","Ass"),new Karte("Karo","Ass"),new Karte("Kreuz","Ass"));
|
||
|
|
||
|
|
||
|
assertNotNull(handRandom);
|
||
|
assertTrue(hand1.isBlackJack());
|
||
|
|
||
|
assertEquals(15,hand2.getPunkte());
|
||
|
assertEquals(12,hand3.getPunkte());
|
||
|
assertEquals(20,hand4.getPunkte());
|
||
|
assertEquals(14,hand5.getPunkte());
|
||
|
}
|
||
|
}
|