upload
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
|
||||
import hhn.temp.project.Main;
|
||||
import hhn.temp.project.TaskManager;
|
||||
import hhn.temp.project.Task;
|
||||
import hhn.temp.project.TaskStatus;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -8,17 +11,47 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class GoodCaseTaskTest {
|
||||
|
||||
private Main main;
|
||||
private TaskManager taskManager;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
main = new Main();
|
||||
Main main = new Main();
|
||||
taskManager = new TaskManager();
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Assert stores initial values")
|
||||
public void assertStringInitialized() {
|
||||
assertTrue(main.loadString().equals("test"));
|
||||
@DisplayName("Create a new Task")
|
||||
public void assertCreateNewTask() {
|
||||
String name = "Name";
|
||||
String description = "Description";
|
||||
Task task = taskManager.createTask(name, description);
|
||||
assertNotNull(task);
|
||||
assertEquals(name, task.getName());
|
||||
assertEquals(description, task.getDescription());
|
||||
assertEquals(TaskStatus.OPEN, task.getStatus());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Edit Task")
|
||||
public void assertEditATask() {
|
||||
String name = "Name";
|
||||
String description = "Description";
|
||||
//String newName = "Name2";
|
||||
String newDescription = "Description2";
|
||||
Task task = taskManager.createTask(name, description);
|
||||
assertNotNull(task);
|
||||
|
||||
assertEquals(description, task.getDescription());
|
||||
task.setDescription(newDescription);
|
||||
assertEquals(newDescription, task.getDescription());
|
||||
|
||||
assertEquals(TaskStatus.OPEN, task.getStatus());
|
||||
task.setStatus(TaskStatus.IN_PROCESS);
|
||||
assertEquals(TaskStatus.IN_PROCESS, task.getStatus());
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user