upload
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m2s

This commit is contained in:
Jan-Philipp Luithardt
2025-12-03 17:57:30 +01:00
parent ed7bd7d1ed
commit 3ddc6bbc15
50 changed files with 282 additions and 114 deletions

View File

@@ -2,7 +2,9 @@ package project;
import hhn.temp.project.Main;
import hhn.temp.project.Task;
import hhn.temp.project.TaskManager;
import hhn.temp.project.TaskStatus;
import hhn.temp.project.expections.TaskAlreadyExistsException;
import hhn.temp.project.expections.TaskHasNoWorkerException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@@ -30,6 +32,7 @@ public class BadCaseTaskTest {
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask(null, null));
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask("", ""));
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask("", "test"));
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask("ä#eadsew2", "test"));
}
@@ -83,4 +86,19 @@ public class BadCaseTaskTest {
}
@Test
@DisplayName("Get a Exeption by setWorker and getWorker")
public void assertExeptionBySetAndGetAuthorOfATask() {
String name = "Name";
String description = "Description";
String workerName = "worker";
Task task = taskManager.createTask(name, description);
assertThrows(TaskHasNoWorkerException.class, () -> task.getWorker());
assertThrows(IllegalArgumentException.class, () -> task.setWorker(null));
assertThrows(IllegalArgumentException.class, () -> task.setWorker(""));
assertThrows(IllegalArgumentException.class, () -> task.setWorker("ewrgi43rfoiw2öa#-"));
}
}