Rough Skeleton for Tests and Classes

This commit is contained in:
2025-12-03 16:28:17 +01:00
parent 668a76e26c
commit c5e26bf594
8 changed files with 91 additions and 17 deletions

View File

@@ -0,0 +1,4 @@
package hhn.temp.project;
public class Admin extends Worker{
}

View File

@@ -0,0 +1,12 @@
package hhn.temp.project;
import java.util.ArrayList;
import java.util.List;
public class AssignmentManager {
List<Worker> workerList;
public AssignmentManager() {
workerList = new ArrayList<>();
}
}

View File

@@ -1,17 +0,0 @@
package hhn.temp.project;
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");
for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
}
}
}

View File

@@ -0,0 +1,4 @@
package hhn.temp.project;
public class Task {
}

View File

@@ -0,0 +1,6 @@
package hhn.temp.project;
public enum TaskState {
IN_PROGRESS,
FINISHED;
}

View File

@@ -0,0 +1,4 @@
package hhn.temp.project;
public class Worker {
}

View File

@@ -1,12 +1,36 @@
package java; package java;
import hhn.temp.project.AssignmentManager;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
public class BadCasesTest { public class BadCasesTest {
@BeforeEach @BeforeEach
public void setup() { public void setup() {
AssignmentManager manager = new AssignmentManager();
}
@Test
@DisplayName("Assert that added tasks can't be Null")
public void assertNewTasksAreNotNull() {
}
@Test
@DisplayName("Assert List isn't empty after adding a task")
public void assertListNowEmptyAfterAdd() {
}
@Test
@DisplayName("Assert only existing tasks can be edited")
public void assertEditOnlyExistingTasks() {
}
@Test
@DisplayName("Assert Worker can only edit own tasks")
public void assertWorkerMayOnlyEditOwnTasks() {
} }

View File

@@ -1,14 +1,51 @@
package java; package java;
import hhn.temp.project.AssignmentManager;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class GoodCasesTest { public class GoodCasesTest {
@BeforeEach @BeforeEach
public void setup() { public void setup() {
AssignmentManager manager = new AssignmentManager();
}
@Test
@DisplayName("Assert that a Worker can add a Task")
public void assertWorkerCanAddTask() {
}
@Test
@DisplayName("Assert that added Tasks are added to the List")
public void assertTasksShowInList() {
}
@Test
@DisplayName("Assert existing Tasks can be edited")
public void assertExistingTasksCanBeEdited() {
} }
@Test
@DisplayName("Assert that Worker can remove own Task")
public void assertWorkerCanRemoveOwnTask() {
}
@Test
@DisplayName("Assert that Admin can remove every Task")
public void assertAdminCanRemoveEveryTask() {
}
@Test
@DisplayName("Assert deleted Tasks no longer show up in the List")
public void assertDeletedTasksDisappear() {
}
} }