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,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");
}
}