Gitignore + JUnit5 import fix
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user