Bug fixes + removed unused + removed Warnings + Bugfix JavaDoc
This commit is contained in:
		@@ -2,7 +2,6 @@ import at.reisinger.obj.Coins;
 | 
			
		||||
import org.junit.jupiter.api.Test;
 | 
			
		||||
 | 
			
		||||
import static org.junit.jupiter.api.Assertions.assertTrue;
 | 
			
		||||
import static org.junit.jupiter.api.Assertions.fail;
 | 
			
		||||
 | 
			
		||||
public class CoinsTest {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -16,15 +16,9 @@ public class PackageTest {
 | 
			
		||||
    @BeforeEach
 | 
			
		||||
    void setUp() {
 | 
			
		||||
        Card card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
 | 
			
		||||
        Card newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
 | 
			
		||||
        ArrayList<Card> cardsArrayList = new ArrayList<>();
 | 
			
		||||
        ArrayList<Card> cardsArrayList2 = new ArrayList<>();
 | 
			
		||||
        ArrayList<Card> cardsArrayList3 = new ArrayList<>();
 | 
			
		||||
        cardsArrayList.add(card);
 | 
			
		||||
        cardsArrayList2.add(newCard);
 | 
			
		||||
        Cards cards = new Cards(cardsArrayList);
 | 
			
		||||
        Cards newCards = new Cards(cardsArrayList2);
 | 
			
		||||
        Cards nochNewCards = new Cards(cardsArrayList3);
 | 
			
		||||
        myPackage = new Package(cards,"Name", 100);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,8 +4,6 @@ import at.reisinger.obj.*;
 | 
			
		||||
import org.junit.jupiter.api.BeforeEach;
 | 
			
		||||
import org.junit.jupiter.api.Test;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
 | 
			
		||||
import static org.junit.jupiter.api.Assertions.*;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -16,27 +14,8 @@ public class TradingDealTest {
 | 
			
		||||
 | 
			
		||||
    @BeforeEach
 | 
			
		||||
    void setUp() {
 | 
			
		||||
        //at.reisinger.Stack
 | 
			
		||||
        card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
 | 
			
		||||
        newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
 | 
			
		||||
        ArrayList<Card> cardsArrayList = new ArrayList<>();
 | 
			
		||||
        ArrayList<Card> cardsArrayList2 = new ArrayList<>();
 | 
			
		||||
        ArrayList<Card> cardsArrayList3 = new ArrayList<>();
 | 
			
		||||
        cardsArrayList.add(card);
 | 
			
		||||
        cardsArrayList2.add(newCard);
 | 
			
		||||
        Cards cards = new Cards(cardsArrayList);
 | 
			
		||||
        Cards newCards = new Cards(cardsArrayList2);
 | 
			
		||||
        Cards nochNewCards = new Cards(cardsArrayList3);
 | 
			
		||||
 | 
			
		||||
        //at.reisinger.obj.Coins
 | 
			
		||||
        Coins coins = new Coins(10);
 | 
			
		||||
        //at.reisinger.obj.User
 | 
			
		||||
        Credentials credentials = new Credentials("username", "passwort");
 | 
			
		||||
        Credentials newCredentials = new Credentials("usernamenew", "passwortnew");
 | 
			
		||||
        User user = new User(credentials, "name", "nachname", "email", coins, "BIO", "IMAGE");
 | 
			
		||||
        User userNew = new User(newCredentials, "nameNew", "nachnameNew", "emailNew", coins, "BIO", "IMAGE");
 | 
			
		||||
 | 
			
		||||
        //Trading Deal
 | 
			
		||||
        Card cardToTrade = card;
 | 
			
		||||
        ElementTyp requiredElementType = ElementTyp.FIRE;
 | 
			
		||||
        double requiredMinDamage = 100;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,41 +1,16 @@
 | 
			
		||||
import at.reisinger.obj.*;
 | 
			
		||||
import at.reisinger.enums.CardType;
 | 
			
		||||
import at.reisinger.enums.ElementTyp;
 | 
			
		||||
import at.reisinger.obj.Package;
 | 
			
		||||
import org.junit.jupiter.api.BeforeEach;
 | 
			
		||||
import org.junit.jupiter.api.Test;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
 | 
			
		||||
import static org.junit.jupiter.api.Assertions.assertEquals;
 | 
			
		||||
import static org.junit.jupiter.api.Assertions.assertTrue;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
public class UserTest {
 | 
			
		||||
    private TradingDeal tradingDeal;
 | 
			
		||||
    private User user;
 | 
			
		||||
    private Package myPackage;
 | 
			
		||||
 | 
			
		||||
    @BeforeEach
 | 
			
		||||
    void setUp() {
 | 
			
		||||
        //at.reisinger.Stack
 | 
			
		||||
        Card card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
 | 
			
		||||
        Card newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
 | 
			
		||||
        ArrayList<Card> cardsArrayList = new ArrayList<>();
 | 
			
		||||
        ArrayList<Card> cardsArrayList2 = new ArrayList<>();
 | 
			
		||||
        ArrayList<Card> cardsArrayList3 = new ArrayList<>();
 | 
			
		||||
        cardsArrayList.add(card);
 | 
			
		||||
        cardsArrayList2.add(newCard);
 | 
			
		||||
        Cards cards = new Cards(cardsArrayList);
 | 
			
		||||
        Cards newCards = new Cards(cardsArrayList2);
 | 
			
		||||
        Cards nochNewCards = new Cards(cardsArrayList3);
 | 
			
		||||
        //at.reisinger.obj.Package
 | 
			
		||||
        myPackage = new Package(cards, "Name", 100);
 | 
			
		||||
 | 
			
		||||
        //at.reisinger.obj.Coins
 | 
			
		||||
        Coins coins = new Coins(10);
 | 
			
		||||
        //at.reisinger.obj.User
 | 
			
		||||
        Credentials credentials = new Credentials("username", "pw");
 | 
			
		||||
        user = new User(credentials, "name", "nachname", "email", coins, "BIO", "IMAGE");
 | 
			
		||||
    }
 | 
			
		||||
@@ -76,10 +51,4 @@ public class UserTest {
 | 
			
		||||
        String result = user.getEmail();
 | 
			
		||||
        assertEquals(newstring, result);
 | 
			
		||||
    }
 | 
			
		||||
    @Test
 | 
			
		||||
    public void test_buyPackage(){
 | 
			
		||||
        Cards cards;
 | 
			
		||||
            cards = new Cards(user.buyPackage(myPackage));
 | 
			
		||||
        assertTrue(Objects.requireNonNull(cards).equals(new Cards(myPackage.getCards())));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user