|
@ -7,16 +7,14 @@ import static org.junit.jupiter.api.Assertions.*; |
|
|
class TasksFrameTest { |
|
|
class TasksFrameTest { |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setupLeibnizR() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
void setupLeibnizR() { |
|
|
TasksFrame tasksFrame = new TasksFrame(); |
|
|
TasksFrame tasksFrame = new TasksFrame(); |
|
|
double x = tasksFrame.setupLeibnizR(100000); |
|
|
double x = tasksFrame.setupLeibnizR(100000); |
|
|
assertEquals(Math.PI/4, x, 0.00001, "Die Werte sind unterschiedlich. Soll: 0.785 Ist:" +x); |
|
|
assertEquals(Math.PI/4, x, 0.00001, "Die Werte sind unterschiedlich. Soll: 0.785 Ist:" +x); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setupDiff() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
void setupDiff(){ |
|
|
TasksFrame frame = new TasksFrame(); |
|
|
TasksFrame frame = new TasksFrame(); |
|
|
int diff = frame.calcDiff(6, 7); |
|
|
int diff = frame.calcDiff(6, 7); |
|
|
assertEquals(-1, diff); |
|
|
assertEquals(-1, diff); |
|
@ -27,8 +25,7 @@ class TasksFrameTest { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setupSumm() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
void setupSumm(){ |
|
|
TasksFrame frame = new TasksFrame(); |
|
|
TasksFrame frame = new TasksFrame(); |
|
|
int sum1 = frame.calcSumm(23, 11); |
|
|
int sum1 = frame.calcSumm(23, 11); |
|
|
assertEquals(34, sum1); |
|
|
assertEquals(34, sum1); |
|
@ -39,8 +36,7 @@ class TasksFrameTest { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setupSumFromTo() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
void setupSumFromTo(){ |
|
|
TasksFrame frame = new TasksFrame(); |
|
|
TasksFrame frame = new TasksFrame(); |
|
|
int p1= frame.sumCalc(1,5); |
|
|
int p1= frame.sumCalc(1,5); |
|
|
assertEquals(15,p1); |
|
|
assertEquals(15,p1); |
|
@ -50,6 +46,29 @@ class TasksFrameTest { |
|
|
assertEquals(3,p3); |
|
|
assertEquals(3,p3); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void test_ePhi(){ |
|
|
|
|
|
TasksFrame tasksFrame = new TasksFrame(); |
|
|
|
|
|
int i = tasksFrame.ePhi( 10); |
|
|
|
|
|
assertEquals(4, i); |
|
|
|
|
|
int a = tasksFrame.ePhi(25); |
|
|
|
|
|
assertEquals(20, a); |
|
|
|
|
|
int b = tasksFrame.ePhi(15); |
|
|
|
|
|
assertEquals(8, b); |
|
|
|
|
|
int c = tasksFrame.ePhi(35); |
|
|
|
|
|
assertEquals(24, c); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void test_ggt(){ |
|
|
|
|
|
TasksFrame tasksFrame = new TasksFrame(); |
|
|
|
|
|
int ggt1 = tasksFrame.ggt(4, 20); |
|
|
|
|
|
assertEquals(4, ggt1); |
|
|
|
|
|
int ggt2 = tasksFrame.ggt(205, 120); |
|
|
|
|
|
assertEquals(5, ggt2); |
|
|
|
|
|
int ggt3 = tasksFrame.ggt(262, 599); |
|
|
|
|
|
assertEquals(1, ggt3); |
|
|
|
|
|
} |
|
|
@Test |
|
|
@Test |
|
|
void setupArea() |
|
|
void setupArea() |
|
|
{ |
|
|
{ |
|
|