Browse Source

Test ePhi-Funktion

remotes/origin/develop
fdai6040 2 years ago
parent
commit
fc3d1c0e6c
  1. 4
      src/main/java/src/TasksFrame.java
  2. 12
      src/test/java/src/TasksFrameTest.java

4
src/main/java/src/TasksFrame.java

@ -109,7 +109,7 @@ public class TasksFrame extends JFrame {
}
private int ePhi(Integer n) {
public int ePhi(Integer n) {
LinkedList<Object> menge = new LinkedList<>();
@ -121,7 +121,7 @@ public class TasksFrame extends JFrame {
return menge.size();
}
private int ggt(int a, int b) {
public int ggt(int a, int b) {
int h;
if (a == 0) return 0;

12
src/test/java/src/TasksFrameTest.java

@ -46,6 +46,18 @@ class TasksFrameTest {
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);
}
}

Loading…
Cancel
Save