Browse Source

Refactor

feature_solitaer_Bugfix
Alexander Hartung 3 years ago
parent
commit
462b2e0a5f
  1. 12
      src/main/java/solitaer/Card.java
  2. 4
      src/test/java/solitaer/AblageStackTest.java
  3. 4
      src/test/java/solitaer/CardDeckTest.java
  4. 4
      src/test/java/solitaer/StartStackTest.java

12
src/main/java/solitaer/Card.java

@ -21,19 +21,19 @@ public class Card extends JPanel {
private final int IMAGE_WIDTH = 72;
private final int IMAGE_HIGHT = 96;
public Card(int nr, Symbol symbol, boolean faceUp) {
public Card(int _nr, Symbol _symbol, boolean _faceUp) {
this.setSize(IMAGE_WIDTH,IMAGE_HIGHT);
this.nr = nr;
this.symbol = symbol;
this.faceUp = faceUp;
this.nr = _nr;
this.symbol = _symbol;
this.faceUp = _faceUp;
}
public boolean isFaceUp() {
return faceUp;
}
public void setFaceUp(boolean faceUp) {
this.faceUp = faceUp;
public void setFaceUp(boolean _faceUp) {
this.faceUp = _faceUp;
}
public int getNr() {

4
src/test/java/solitaer/AblageStackTest.java

@ -12,9 +12,9 @@ class AblageStackTest {
@ParameterizedTest
@MethodSource("testAblageStackTestDaten")
void testRulesetAblageStack(String msg, Card _stapel, Card _spieler, boolean _expectedResult) {
void testRulesetAblageStack(String _msg, Card _stapel, Card _spieler, boolean _expectedResult) {
AblageStack stack = new AblageStack(0, 0, Symbol.Kreuz);
assertEquals(_expectedResult, stack.cardCheck(_stapel, _spieler), msg);
assertEquals(_expectedResult, stack.cardCheck(_stapel, _spieler), _msg);
}
private static Stream<Arguments> testAblageStackTestDaten(){

4
src/test/java/solitaer/CardDeckTest.java

@ -25,7 +25,7 @@ class CardDeckTest {
@ParameterizedTest
@MethodSource("testSymbole")
//Jedes Symbol muss einmal vorhand sein
void testCardDeckSymbole(String msg, Symbol _sym) {
void testCardDeckSymbole(String _msg, Symbol _sym) {
boolean result = false;
@ -36,7 +36,7 @@ class CardDeckTest {
}
}
assertTrue(result, msg);
assertTrue(result, _msg);
}

4
src/test/java/solitaer/StartStackTest.java

@ -13,9 +13,9 @@ class StartStackTest {
@ParameterizedTest
@MethodSource("testStartStackTestDaten")
//Jedes Symbol muss einmal vorhand sein
void testRulesetStartStack(String msg, Card _stapel, Card _spieler, boolean _expectedResult) {
void testRulesetStartStack(String _msg, Card _stapel, Card _spieler, boolean _expectedResult) {
StartStack stack = new StartStack(10, 10);
assertEquals(_expectedResult, stack.cardCheck(_stapel, _spieler), msg);
assertEquals(_expectedResult, stack.cardCheck(_stapel, _spieler), _msg);
}

Loading…
Cancel
Save