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_WIDTH = 72;
private final int IMAGE_HIGHT = 96; 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.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() { public boolean isFaceUp() {
return faceUp; return faceUp;
} }
public void setFaceUp(boolean faceUp) {
this.faceUp = faceUp;
public void setFaceUp(boolean _faceUp) {
this.faceUp = _faceUp;
} }
public int getNr() { public int getNr() {

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

@ -12,9 +12,9 @@ class AblageStackTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("testAblageStackTestDaten") @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); 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(){ private static Stream<Arguments> testAblageStackTestDaten(){

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

@ -25,7 +25,7 @@ class CardDeckTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("testSymbole") @MethodSource("testSymbole")
//Jedes Symbol muss einmal vorhand sein //Jedes Symbol muss einmal vorhand sein
void testCardDeckSymbole(String msg, Symbol _sym) {
void testCardDeckSymbole(String _msg, Symbol _sym) {
boolean result = false; 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 @ParameterizedTest
@MethodSource("testStartStackTestDaten") @MethodSource("testStartStackTestDaten")
//Jedes Symbol muss einmal vorhand sein //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); StartStack stack = new StartStack(10, 10);
assertEquals(_expectedResult, stack.cardCheck(_stapel, _spieler), msg);
assertEquals(_expectedResult, stack.cardCheck(_stapel, _spieler), _msg);
} }

Loading…
Cancel
Save