Browse Source

init AblageStack

feature_solitaer_AblageStack
Alexander Hartung 3 years ago
parent
commit
65a829fbff
  1. 21
      src/main/java/solitaer/AblageStack.java
  2. 28
      src/test/java/solitaer/AblageStackTest.java

21
src/main/java/solitaer/AblageStack.java

@ -0,0 +1,21 @@
package solitaer;
public class AblageStack extends BaseStack {
private static final long serialVersionUID = 1L;
public AblageStack(int _x, int _y) {
super();
super.setLocation(_x, _y);
super.setSize(IMAGE_WIDTH, STACK_HIGHT);
super.setOpaque(false);
super.setLayout(null);
}
@Override
protected boolean cardCheck(Card _topStack, Card _playerCard) {
// TODO Auto-generated method stub
return true;
}
}

28
src/test/java/solitaer/AblageStackTest.java

@ -0,0 +1,28 @@
package solitaer;
import static org.junit.jupiter.api.Assertions.*;
import java.util.stream.Stream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
class AblageStackTest {
@ParameterizedTest
@MethodSource("testAblageStackTestDaten")
void testRulesetStartStack(String msg, Card _stapel, Card _spieler, boolean _expectedResult) {
AblageStack stack = new AblageStack(0, 0);
assertEquals(_expectedResult, stack.cardCheck(_stapel, _spieler), msg);
}
private static Stream<Arguments> testAblageStackTestDaten(){
return Stream.of(
Arguments.of("Ass-Kreuz auf Leeres Feld",
null,
new Card(1, Symbol.Kreuz, true), true)
);
}
}
Loading…
Cancel
Save