upload
This commit is contained in:
@@ -2,6 +2,7 @@ package project;
|
||||
import hhn.temp.project.Main;
|
||||
import hhn.temp.project.Task;
|
||||
import hhn.temp.project.TaskManager;
|
||||
import hhn.temp.project.expections.TaskAlreadyExistsException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -26,9 +27,17 @@ public class BadCaseTaskTest {
|
||||
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask(null, ""));
|
||||
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask(null, null));
|
||||
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask("", ""));
|
||||
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask("test", ""));
|
||||
assertThrows(IllegalArgumentException.class,() -> taskManager.createTask("", "test"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Assert an IllegalArgumentException when you create a new Task with the same Name of a exits Task")
|
||||
public void assertExceptionOnCreateNewTaskWithExitsName() {
|
||||
String name = "Name";
|
||||
String description = "Description";
|
||||
assertDoesNotThrow(() -> taskManager.createTask(name, description));
|
||||
assertThrows(TaskAlreadyExistsException.class, () -> taskManager.createTask(name, description));
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +49,6 @@ public class BadCaseTaskTest {
|
||||
Task task = taskManager.createTask(name, description);
|
||||
|
||||
assertThrows(IllegalArgumentException.class, () -> task.setDescription(null));
|
||||
assertThrows(IllegalArgumentException.class, () -> task.setDescription(""));
|
||||
assertThrows(IllegalArgumentException.class, () -> task.setStatus(null));
|
||||
|
||||
|
||||
@@ -50,7 +58,7 @@ public class BadCaseTaskTest {
|
||||
@DisplayName("Assert an IllegalArgumentException when calling a non-Existing Task")
|
||||
public void assertExceptionOnCallingANonextistingTask (){
|
||||
String name = " Manager";
|
||||
assertThrows(IllegalArgumentException.class, () -> !name.equals(taskManager.getName()));
|
||||
//assertThrows(IllegalArgumentException.class, () -> !name.equals(taskManager.getName()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user