package programmiermethoden_und_Werkzeuge; import static org.junit.Assert.*; import org.junit.Test; public class TaschenrechnerTest { @Test public void testAddition() { int a = 3; int b = 4; int ab = a + b; int result = Taschenrechner.addition(a,b); assertEquals(ab, result); } @Test public void testMultiplikation() { int a = 6; int b = 6; int ab = a * b; int result = Taschenrechner.multiplikation(a, b); assertEquals(ab, result); } @Test public void testDivision() { int a = 14; int b = 7; int ab = a / b; int result = Taschenrechner.division(a, b); assertEquals(ab, result); } @Test public void testPotenzieren() { int a = 2; int b = 3; int ab = (int)Math.pow(a, b); int result = Taschenrechner.potenzieren(a, b); assertEquals(ab, result); } @Test public void testKleinerAls() { int a = 9; int b = 6; boolean ab = ab; boolean result = Taschenrechner.groeßerAls(a, b); assertEquals(ab, result); } @Test public void testGleich() { int a = 5; int b = 5; boolean ab = a==b; boolean result = Taschenrechner.gleich(a, b); assertEquals(ab, result); } @Test public void testRandomIntegerNummer() { int a = 2; int b = 10; int r = (int) (Math.random() * (a + 1)) + b; boolean result = r > a && r >= b; assertEquals(true, result); } }