From 65a829fbff195e5445f35bd0c37368a2a828e4de Mon Sep 17 00:00:00 2001 From: Alexander Hartung Date: Sat, 29 Jan 2022 16:37:22 +0100 Subject: [PATCH] init AblageStack --- src/main/java/solitaer/AblageStack.java | 21 ++++++++++++++++ src/test/java/solitaer/AblageStackTest.java | 28 +++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/main/java/solitaer/AblageStack.java create mode 100644 src/test/java/solitaer/AblageStackTest.java diff --git a/src/main/java/solitaer/AblageStack.java b/src/main/java/solitaer/AblageStack.java new file mode 100644 index 0000000..7cb9fbe --- /dev/null +++ b/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; + } + +} diff --git a/src/test/java/solitaer/AblageStackTest.java b/src/test/java/solitaer/AblageStackTest.java new file mode 100644 index 0000000..4a9283e --- /dev/null +++ b/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 testAblageStackTestDaten(){ + return Stream.of( + Arguments.of("Ass-Kreuz auf Leeres Feld", + null, + new Card(1, Symbol.Kreuz, true), true) + ); + } + +}