Gitignore + JUnit5 import fix

This commit is contained in:
2020-10-15 10:42:53 +02:00
parent dcbb133489
commit cfdab3230d
11 changed files with 72 additions and 29 deletions

View File

@ -1,9 +1,6 @@
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CardTest {

View File

@ -1,8 +1,9 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CardsTest {
public Card newCard, card;
public Cards cards;

View File

@ -1,19 +1,15 @@
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;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assertions.assertFalse;
public class CoinsTest {
@Test
public void test_getCoinAmount(){
Coins coin = new Coins(10);
assertTrue("Fehler getCoinAmmount ist negativ",coin.getCoinAmount() >= 0);
assertTrue(coin.getCoinAmount() >= 0);
}
@Test
@ -23,7 +19,7 @@ public class CoinsTest {
coin.addCoin(-10);
fail("Erwartet NegativAmountException - addCoin");
}catch (NegativAmountException negativAmountException) {
assertThat(negativAmountException.getMessage(), is("negativAmountException"));
assertTrue(negativAmountException.getMessage()=="negativAmountException");
}
}
@ -34,7 +30,7 @@ public class CoinsTest {
coin.removeCoin(-10);
fail("Erwartet NegativAmountException - removeCoin");
}catch (NegativAmountException negativAmountException) {
assertThat(negativAmountException.getMessage(), is("negativAmountException"));
assertTrue(negativAmountException.getMessage()=="negativAmountException");
}
}

View File

@ -3,7 +3,8 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class PackageTest {
private Cards newCards, cards, nochNewCards;

View File

@ -0,0 +1,18 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.mockito.Mockito.mock;
public class SimpleCardTest {
@Test
@DisplayName("Test - getName()")
public void test_getName(){
//arrange
Card mockedA = mock(Card.class); //Erstellt einen Mock
String name = "Neuer Name";
//act
//assert
}
}

View File

@ -3,7 +3,8 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class StackTest {
private Cards newCards, cards, nochNewCards;

View File

@ -3,7 +3,7 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class StoreTest {

View File

@ -3,7 +3,8 @@ import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class TradingDealTest {

View File

@ -1,9 +1,10 @@
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class UserTest {
private TradingDeal tradingDeal;