diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 493c880..af721d2 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,20 @@ at.reisinger.mtcg MTCG 1.0-SNAPSHOT + + + junit + junit + RELEASE + test + + + org.junit.jupiter + junit-jupiter + RELEASE + test + + \ No newline at end of file diff --git a/src/main/java/Battle.java b/src/main/java/Battle.java new file mode 100644 index 0000000..b1d3db6 --- /dev/null +++ b/src/main/java/Battle.java @@ -0,0 +1,2 @@ +public class Battle { +} diff --git a/src/main/java/Card.java b/src/main/java/Card.java new file mode 100644 index 0000000..3d57be6 --- /dev/null +++ b/src/main/java/Card.java @@ -0,0 +1,37 @@ +public class Card { + public Card(String name, double damage, ElementTyp elementTyp, CardType cardType) { + + } + + public String getName() { + return ""; + } + + public int getDamage() { + return 0; + } + + public ElementTyp getElementTyp() { + return null; + } + + public CardType getCardType() { + return null; + } + + public EffectivnessType getEffectivenessAgainst() { + return null; + } + + public boolean setName(String neuerName) { + return false; + } + + public boolean setDamage(int damage) { + return false; + } + + public boolean setElementType(ElementTyp elementTyp) { + return false; + } +} diff --git a/src/main/java/CardType.java b/src/main/java/CardType.java new file mode 100644 index 0000000..6256f99 --- /dev/null +++ b/src/main/java/CardType.java @@ -0,0 +1,3 @@ +public enum CardType { + MONSTER, SPELL +} diff --git a/src/main/java/Cards.java b/src/main/java/Cards.java new file mode 100644 index 0000000..1710848 --- /dev/null +++ b/src/main/java/Cards.java @@ -0,0 +1,23 @@ +import java.util.ArrayList; + +public class Cards { + public Cards(ArrayList cardsArrayList) { + + } + + public Cards() { + + } + + public void addCard(Card newCard) { + + } + + public ArrayList getCards() { + return null; + } + + public boolean delCard(Card delCard) { + return false; + } +} diff --git a/src/main/java/Coins.java b/src/main/java/Coins.java new file mode 100644 index 0000000..480e72f --- /dev/null +++ b/src/main/java/Coins.java @@ -0,0 +1,21 @@ +public class Coins { + public Coins(int coins) { + + } + + public int getCoinAmount() { + return 0; + } + + public void addCoin(int coins) throws NegativAmountException{ + throw new NegativAmountException(); + } + + public boolean removeCoin(int coins) throws NegativAmountException{ + throw new NegativAmountException(); + } + + public boolean changeCoinAmmount(int coins) { + return false; + } +} diff --git a/src/main/java/Credentials.java b/src/main/java/Credentials.java new file mode 100644 index 0000000..f9f52d3 --- /dev/null +++ b/src/main/java/Credentials.java @@ -0,0 +1,2 @@ +public class Credentials { +} diff --git a/src/main/java/DBConnection.java b/src/main/java/DBConnection.java new file mode 100644 index 0000000..508cea6 --- /dev/null +++ b/src/main/java/DBConnection.java @@ -0,0 +1,2 @@ +public class DBConnection { +} diff --git a/src/main/java/EffectivnessType.java b/src/main/java/EffectivnessType.java new file mode 100644 index 0000000..64b64b7 --- /dev/null +++ b/src/main/java/EffectivnessType.java @@ -0,0 +1,5 @@ +public enum EffectivnessType { + EFFEKTIVE, + NOTEFFEKTIVE, + NOEFFEKT +} diff --git a/src/main/java/ElementTyp.java b/src/main/java/ElementTyp.java new file mode 100644 index 0000000..df2fa30 --- /dev/null +++ b/src/main/java/ElementTyp.java @@ -0,0 +1,3 @@ +public enum ElementTyp { + WATER, FIRE +} diff --git a/src/main/java/MonsterCard.java b/src/main/java/MonsterCard.java new file mode 100644 index 0000000..2036952 --- /dev/null +++ b/src/main/java/MonsterCard.java @@ -0,0 +1,5 @@ +public class MonsterCard extends Card{ + public MonsterCard(String name, double damage, ElementTyp elementTyp, CardType cardType) { + super(name, damage, elementTyp, cardType); + } +} diff --git a/src/main/java/NegativAmountException.java b/src/main/java/NegativAmountException.java new file mode 100644 index 0000000..7a79134 --- /dev/null +++ b/src/main/java/NegativAmountException.java @@ -0,0 +1,2 @@ +public class NegativAmountException extends Exception { +} diff --git a/src/main/java/Package.java b/src/main/java/Package.java new file mode 100644 index 0000000..9abf442 --- /dev/null +++ b/src/main/java/Package.java @@ -0,0 +1,17 @@ +public class Package extends Cards{ + public Package(Cards stack, Cards deck, String name, int price) { + + } + + public String getName() { + return null; + } + + public int getPrice() { + return 0; + } + + public void setName(String neuName) { + + } +} diff --git a/src/main/java/SpellCard.java b/src/main/java/SpellCard.java new file mode 100644 index 0000000..fb74e62 --- /dev/null +++ b/src/main/java/SpellCard.java @@ -0,0 +1,5 @@ +public class SpellCard extends Card{ + public SpellCard(String name, double damage, ElementTyp elementTyp, CardType cardType) { + super(name, damage, elementTyp, cardType); + } +} diff --git a/src/main/java/Stack.java b/src/main/java/Stack.java new file mode 100644 index 0000000..2e63a5f --- /dev/null +++ b/src/main/java/Stack.java @@ -0,0 +1,17 @@ +public class Stack extends Cards{ + public Stack(Cards cards, Cards nochNewCards) { + + } + + public void addDeck(Cards newCards) { + + } + + public Cards getDeck() { + return null; + } + + public boolean delDeck(Cards delCards) { + return false; + } +} diff --git a/src/main/java/Store.java b/src/main/java/Store.java new file mode 100644 index 0000000..8fd1096 --- /dev/null +++ b/src/main/java/Store.java @@ -0,0 +1,15 @@ +import java.util.ArrayList; + +public interface Store { + DBConnection db = new DBConnection(); + + void addTradingDeal(TradingDeal tradingDeal); + + ArrayList getTradingDeals(); + + boolean doTrading(TradingDeal tradingDeal1, TradingDeal tradingDeal2); + + ArrayList getPossibleTradingDeals(); + + ArrayList getPossibleAvailableTradingDeals(); +} diff --git a/src/main/java/TradingDeal.java b/src/main/java/TradingDeal.java new file mode 100644 index 0000000..a09dc28 --- /dev/null +++ b/src/main/java/TradingDeal.java @@ -0,0 +1,43 @@ +public class TradingDeal { + public TradingDeal(User user, Card cardToTrade, ElementTyp requiredElementType, double requiredMinDamage, CardType requiredCardType) { + } + + public User getTradingUser() { + return null; + } + + public Card getCardToTrade() { + return null; + } + + public ElementTyp getRequiredElementType() { + return null; + } + + public int getRequiredMinDamage() { + return 0; + } + + public CardType getRequiredCardType() { + return null; + } + + public void setTradingUser(User user) { + + } + + public void setCardToTrade(Card card) { + + } + + public void setRequiredElementType(ElementTyp elementTyp) { + } + + public void setRequiredMinDamage(int damage) { + + } + + public void setRequiredCardType(CardType cardType) { + + } +} diff --git a/src/main/java/User.java b/src/main/java/User.java new file mode 100644 index 0000000..0e68ec7 --- /dev/null +++ b/src/main/java/User.java @@ -0,0 +1,55 @@ +import java.util.ArrayList; + +public class User implements Store{ + public User(Credentials credentials, String name, String nachname, String email, Stack stack, Coins coins) { + + } + + public String getName() { + return null; + } + + public String getNachname() { + return null; + } + + public String getEmail() { + return null; + } + + public String setName(String name) { + return null; + } + + public String setNachname(String nachname) { + return null; + } + + public String setEmail(String email) { + return null; + } + + public Cards buyPackage(Package mypackage) { + return null; + } + + public void addTradingDeal(TradingDeal tradingDeal) { + + } + + public ArrayList getTradingDeals() { + return null; + } + + public boolean doTrading(TradingDeal tradingDeal1, TradingDeal tradingDeal2) { + return false; + } + + public ArrayList getPossibleTradingDeals() { + return null; + } + + public ArrayList getPossibleAvailableTradingDeals() { + return null; + } +} diff --git a/src/test/java/CardTest.java b/src/test/java/CardTest.java new file mode 100644 index 0000000..2aedfe5 --- /dev/null +++ b/src/test/java/CardTest.java @@ -0,0 +1,56 @@ +import org.junit.Test; + + + + +import static org.junit.Assert.*; + +public class CardTest { + + @Test + public void test_getName() { + Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL); + assertTrue(card.getName() != ""); + } + @Test + public void test_getDamage() { + Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL); + assertTrue(card.getDamage() >= 0); + } + @Test + public void test_getElementType() { + Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL); + ElementTyp elementTyp = card.getElementTyp(); + assertTrue(elementTyp != null); + } + @Test + public void test_getCardType() { + Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL); + CardType cardType = card.getCardType(); + assertTrue(cardType != null); + } + @Test + public void test_getEffectivenessAgainst() { + Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL); + EffectivnessType effectivnessType = card.getEffectivenessAgainst(); + assertTrue(effectivnessType != null); + } + @Test + public void test_setName() { + Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL); + boolean result = card.setName("NeuerName"); + assertTrue(result); + } + @Test + public void test_setDamage() { + Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL); + boolean result = card.setDamage(100); + assertTrue(result); + } + @Test + public void test_setElementTyp() { + Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL); + boolean result = card.setElementType(ElementTyp.WATER); + assertTrue(result); + } +} diff --git a/src/test/java/CardsTest.java b/src/test/java/CardsTest.java new file mode 100644 index 0000000..eb40f8c --- /dev/null +++ b/src/test/java/CardsTest.java @@ -0,0 +1,37 @@ +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import static org.junit.Assert.assertTrue; +import java.util.ArrayList; + +public class CardsTest { + public Card newCard, card; + public Cards cards; + public ArrayList cardsArrayList; + @BeforeEach + void setUp() { + card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER); + newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL); + cardsArrayList = new ArrayList(); + cardsArrayList.add(card); + cards = new Cards(cardsArrayList); + } + + @Test + void test_addCard() { + ArrayList result = cards.getCards(); + cards.addCard(newCard); + cardsArrayList.add(newCard); + assertTrue(result == cardsArrayList); + } + @Test + void test_delCard() { + boolean result = cards.delCard(newCard); + assertTrue(result); + } + @Test + void test_getCards() { + ArrayList result = cards.getCards(); + assertTrue(result == cardsArrayList); + } + +} diff --git a/src/test/java/CoinsTest.java b/src/test/java/CoinsTest.java new file mode 100644 index 0000000..580f423 --- /dev/null +++ b/src/test/java/CoinsTest.java @@ -0,0 +1,62 @@ +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.CoreMatchers.anyOf; +import static org.hamcrest.CoreMatchers.hasItems; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.*; + +import org.junit.Test; + + +public class CoinsTest { + + @Test + public void test_getCoinAmount(){ + Coins coin = new Coins(10); + assertTrue("Fehler getCoinAmmount ist negativ",coin.getCoinAmount() >= 0); + } + + @Test + public void test_addCoinException(){ + try { + Coins coin = new Coins(10); + coin.addCoin(-10); + fail("Erwartet NegativAmountException - addCoin"); + }catch (NegativAmountException negativAmountException) { + assertThat(negativAmountException.getMessage(), is("negativAmountException")); + } + } + + @Test + public void test_removeCoinException(){ + try { + Coins coin = new Coins(10); + coin.removeCoin(-10); + fail("Erwartet NegativAmountException - removeCoin"); + }catch (NegativAmountException negativAmountException) { + assertThat(negativAmountException.getMessage(), is("negativAmountException")); + } + } + + @Test + public void test_removeCoin(){ + Coins coin = new Coins(10); + try { + assertTrue(coin.removeCoin(10)); + } catch (NegativAmountException e) { + e.printStackTrace(); + } + } + + @Test + public void test_changeCoinAmount_true(){ + Coins coin = new Coins(10); + assertTrue(coin.changeCoinAmmount(-10)); + } + + @Test + public void test_changeCoinAmount_false(){ + Coins coin = new Coins(9); + assertFalse(coin.changeCoinAmmount(-10)); + } +} diff --git a/src/test/java/PackageTest.java b/src/test/java/PackageTest.java new file mode 100644 index 0000000..9d8fb99 --- /dev/null +++ b/src/test/java/PackageTest.java @@ -0,0 +1,46 @@ +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; + +import static org.junit.Assert.assertTrue; + +public class PackageTest { + private Cards newCards, cards, nochNewCards; + private Card newCard, card; + private ArrayList cardsArrayList, cardsArrayList2, cardsArrayList3; + private Package myPackage; + @BeforeEach + void setUp() { + card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER); + newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL); + cardsArrayList = new ArrayList(); + cardsArrayList2 = new ArrayList(); + cardsArrayList3 = new ArrayList(); + cardsArrayList.add(card); + cardsArrayList2.add(newCard); + cards = new Cards(cardsArrayList); + newCards = new Cards(cardsArrayList2); + nochNewCards = new Cards(cardsArrayList3); + myPackage = new Package(cards, nochNewCards, "Name", 100); + } + + @Test + void test_getName() { + String result = myPackage.getName(); + assertTrue(result=="Name"); + } + + @Test + void test_getPrice() { + int result = myPackage.getPrice(); + assertTrue(result==100); + } + + @Test + void test_setName() { + myPackage.setName("neuName"); + String result = myPackage.getName(); + assertTrue(result=="neuName"); + } +} diff --git a/src/test/java/StackTest.java b/src/test/java/StackTest.java new file mode 100644 index 0000000..0b8a4b5 --- /dev/null +++ b/src/test/java/StackTest.java @@ -0,0 +1,43 @@ +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; + +import static org.junit.Assert.assertTrue; + +public class StackTest { + private Cards newCards, cards, nochNewCards; + private Card newCard, card; + private ArrayList cardsArrayList, cardsArrayList2, cardsArrayList3; + private Stack stack; + @BeforeEach + void setUp() { + card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER); + newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL); + cardsArrayList = new ArrayList(); + cardsArrayList2 = new ArrayList(); + cardsArrayList3 = new ArrayList(); + cardsArrayList.add(card); + cardsArrayList2.add(newCard); + cards = new Cards(cardsArrayList); + newCards = new Cards(cardsArrayList2); + nochNewCards = new Cards(cardsArrayList3); + stack = new Stack(cards, nochNewCards); + } + @Test + void test_addDeck() { + stack.addDeck(newCards); + Cards result = stack.getDeck(); + assertTrue(result == newCards); + } + @Test + void test_delDeck() { + boolean result = stack.delDeck(cards); + assertTrue(result); + } + @Test + void test_getDeck() { + Cards result = stack.getDeck(); + assertTrue(result == cards); + } +} diff --git a/src/test/java/StoreTest.java b/src/test/java/StoreTest.java new file mode 100644 index 0000000..cc82604 --- /dev/null +++ b/src/test/java/StoreTest.java @@ -0,0 +1,82 @@ +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; + +import static org.junit.Assert.assertTrue; + +public class StoreTest { + + private TradingDeal tradingDeal; + private Cards newCards, cards, nochNewCards; + private Card newCard, card; + private ArrayList cardsArrayList, cardsArrayList2, cardsArrayList3; + private Stack stack; + private User user, userNew; + private Store store; + + @BeforeEach + void setUp() { + //Stack + card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER); + newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL); + cardsArrayList = new ArrayList(); + cardsArrayList2 = new ArrayList(); + cardsArrayList3 = new ArrayList(); + cardsArrayList.add(card); + cardsArrayList2.add(newCard); + cards = new Cards(cardsArrayList); + newCards = new Cards(cardsArrayList2); + nochNewCards = new Cards(cardsArrayList3); + stack = new Stack(cards, nochNewCards); + + //Coins + Coins coins = new Coins(10); + //User + Credentials credentials = new Credentials(); + user = new User(credentials, "name", "nachname", "email", stack, coins); + userNew = new User(credentials, "nameNew", "nachnameNew", "emailNew", stack, coins); + + //Trading Deal + Card cardToTrade = card; + ElementTyp requiredElementType = ElementTyp.FIRE; + double requiredMinDamage = 100; + CardType requiredCardType = CardType.MONSTER; + tradingDeal = new TradingDeal(user, cardToTrade, requiredElementType, requiredMinDamage, requiredCardType); + + } + + @Test + void test_addTradingDeal() { + user.addTradingDeal(tradingDeal); + ArrayList expected = new ArrayList(); + expected.add(tradingDeal); + assertTrue(user.getTradingDeals() == expected); + } + @Test + void test_doTrade() { + boolean result = user.doTrading(tradingDeal, tradingDeal); + assertTrue(result); + } + @Test + void test_getTradingDeals() { + ArrayList result = user.getTradingDeals(); + ArrayList expected = new ArrayList(); + expected.add(tradingDeal); + assertTrue(result == expected); + } + @Test + void test_getPossibleTradingDeals() { + ArrayList result = user.getPossibleTradingDeals(); + ArrayList expected = new ArrayList(); + expected.add(tradingDeal); + assertTrue(result == expected); + } + @Test + void test_getAvailableTradingDeals() { + ArrayList result = user.getPossibleAvailableTradingDeals(); + ArrayList expected = new ArrayList(); + expected.add(tradingDeal); + assertTrue(result == expected); + } +} diff --git a/src/test/java/TradingDealTest.java b/src/test/java/TradingDealTest.java new file mode 100644 index 0000000..3d32afb --- /dev/null +++ b/src/test/java/TradingDealTest.java @@ -0,0 +1,103 @@ +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; + +import static org.junit.Assert.assertTrue; + +public class TradingDealTest { + + private TradingDeal tradingDeal; + private Cards newCards, cards, nochNewCards; + private Card newCard, card; + private ArrayList cardsArrayList, cardsArrayList2, cardsArrayList3; + private Stack stack; + private User user, userNew; + + @BeforeEach + void setUp() { + //Stack + card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER); + newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL); + cardsArrayList = new ArrayList(); + cardsArrayList2 = new ArrayList(); + cardsArrayList3 = new ArrayList(); + cardsArrayList.add(card); + cardsArrayList2.add(newCard); + cards = new Cards(cardsArrayList); + newCards = new Cards(cardsArrayList2); + nochNewCards = new Cards(cardsArrayList3); + stack = new Stack(cards, nochNewCards); + + //Coins + Coins coins = new Coins(10); + //User + Credentials credentials = new Credentials(); + user = new User(credentials, "name", "nachname", "email", stack, coins); + userNew = new User(credentials, "nameNew", "nachnameNew", "emailNew", stack, coins); + + //Trading Deal + Card cardToTrade = card; + ElementTyp requiredElementType = ElementTyp.FIRE; + double requiredMinDamage = 100; + CardType requiredCardType = CardType.MONSTER; + tradingDeal = new TradingDeal(user, cardToTrade, requiredElementType, requiredMinDamage, requiredCardType); + } + + @Test + void test_getTradingUser() { + User result = tradingDeal.getTradingUser(); + assertTrue(result==user); + } + @Test + void test_getCardToTrade() { + Card result = tradingDeal.getCardToTrade(); + assertTrue(result==card); + } + @Test + void test_getRequiredElementType() { + ElementTyp result = tradingDeal.getRequiredElementType(); + assertTrue(result==ElementTyp.FIRE); + } + @Test + void test_getRequiredMinDamage() { + int result = tradingDeal.getRequiredMinDamage(); + assertTrue(result==100); + } + @Test + void test_getRequiredCardType() { + CardType result = tradingDeal.getRequiredCardType(); + assertTrue(result==CardType.MONSTER); + } + + @Test + void test_setTradingUser() { + tradingDeal.setTradingUser(userNew); + User result = tradingDeal.getTradingUser(); + assertTrue(result==userNew); + } + @Test + void test_setCardToTrade() { + tradingDeal.setCardToTrade(newCard); + Card result = tradingDeal.getCardToTrade(); + assertTrue(result==newCard); + } + @Test + void test_setRequiredElementType() { + tradingDeal.setRequiredElementType(ElementTyp.WATER); + ElementTyp result = tradingDeal.getRequiredElementType(); + assertTrue(result==ElementTyp.WATER); + } + @Test + void test_setRequiredMinDamage() { + tradingDeal.setRequiredMinDamage(10); + int result = tradingDeal.getRequiredMinDamage(); + assertTrue(result==10); + } + @Test + void test_setRequiredCardType() { + tradingDeal.setRequiredCardType(CardType.SPELL); + CardType result = tradingDeal.getRequiredCardType(); + assertTrue(result==CardType.SPELL); + } +} diff --git a/src/test/java/UserTest.java b/src/test/java/UserTest.java new file mode 100644 index 0000000..2dcef10 --- /dev/null +++ b/src/test/java/UserTest.java @@ -0,0 +1,79 @@ +import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; + +import java.util.ArrayList; + +import static org.junit.Assert.assertTrue; + +public class UserTest { + private TradingDeal tradingDeal; + private Cards newCards, cards, nochNewCards; + private Card newCard, card; + private ArrayList cardsArrayList, cardsArrayList2, cardsArrayList3; + private Stack stack; + private User user; + private Package myPackage; + + @BeforeEach + void setUp() { + //Stack + card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER); + newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL); + cardsArrayList = new ArrayList(); + cardsArrayList2 = new ArrayList(); + cardsArrayList3 = new ArrayList(); + cardsArrayList.add(card); + cardsArrayList2.add(newCard); + cards = new Cards(cardsArrayList); + newCards = new Cards(cardsArrayList2); + nochNewCards = new Cards(cardsArrayList3); + stack = new Stack(cards, nochNewCards); + //Package + myPackage = new Package(cards, nochNewCards, "Name", 100); + + //Coins + Coins coins = new Coins(10); + //User + Credentials credentials = new Credentials(); + user = new User(credentials, "name", "nachname", "email", stack, coins); + } + @Test + public void test_getName() { + String result = user.getName(); + assertTrue(result != ""); + } + @Test + public void test_getNachname() { + String result = user.getNachname(); + assertTrue(result != ""); + } + @Test + public void test_getEmail() { + String result = user.getEmail(); + assertTrue(result != ""); + } + + @Test + public void test_setName() { + String newstring = "new"; + String result = user.setName(newstring); + assertTrue(result != newstring); + } + @Test + public void test_setNachname() { + String newstring = "new"; + String result = user.setNachname(newstring); + assertTrue(result != newstring); + } + @Test + public void test_setEmail() { + String newstring = "new"; + String result = user.setEmail(newstring); + assertTrue(result != newstring); + } + @Test + public void test_buyPackage(){ + Cards cards = user.buyPackage(myPackage); + assertTrue(cards != null); + } +}