This commit is contained in:
Jan-Philipp Luithardt
2025-12-03 15:04:30 +01:00
parent 835bd912df
commit 21a95a8388
31 changed files with 99 additions and 33 deletions

View File

@@ -7,6 +7,8 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
public class BadCaseTaskTest {
@@ -57,8 +59,13 @@ public class BadCaseTaskTest {
@Test
@DisplayName("Assert an IllegalArgumentException when calling a non-Existing Task")
public void assertExceptionOnCallingANonextistingTask (){
String name = " Manager";
//assertThrows(IllegalArgumentException.class, () -> !name.equals(taskManager.getName()));
String wrongName = "Manager";
String name = "Name";
String description = "Description";
Task task = taskManager.createTask(name, description);
assertThrows(IllegalArgumentException.class, () -> taskManager.getTask(wrongName));
assertThrows(IllegalArgumentException.class, () -> taskManager.getTask(23));
}