Commit 1c40402a authored by Jean-Mael BOIS's avatar Jean-Mael BOIS
Browse files

isTrash test - Fix #31

isArchived test - Fix #36
Continuity of the TaskTest test - #38
parent 21f512b6
......@@ -66,9 +66,9 @@ public class ProjectTest {
this.project.deleteTask(t2);
assertFalse(this.project.getTaskReference().contains(t2));
}
}
@Test
public void testTasksRemoveAll() {
......@@ -180,6 +180,32 @@ public class ProjectTest {
}
}
@Test
public void testIsArchived() {
ArrayList<ITask> tasks = new ArrayList<>();
Task t6 = new Task();
Task t7 = new Task();
Task t8 = new Task();
tasks.add(t6);
tasks.add(t7);
tasks.add(t8);
project.setTasksList(tasks);
assertFalse(this.project.isArchived());
project.archive();
assertTrue(this.project.isArchived());
List<ITask> tasks2 = project.getTasksList();
for(ITask t : tasks2) {
assertTrue(t.isArchived());
}
}
@Test
public void testProjectName() {
String name = "Beautiful project";
......
package fr.alma.gtd.server.main.donnees;
import fr.alma.gtd.server.core.Frequency;
import fr.alma.gtd.server.core.IParticipant;
import fr.alma.gtd.server.core.ITag;
import fr.alma.gtd.server.core.Progress;
import fr.alma.gtd.server.core.*;
import fr.alma.gtd.server.persistence.data.Utilisateur;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
......@@ -102,22 +99,37 @@ class TaskTest {
this.task.setEndingDate(date);
assertEquals(date, this.task.getEndingDate());
Date new_date = new Date();
assertNotEquals(new_date, date);
}
@Test
public void testIsTrash() {
assertFalse(this.task.isTrash());
this.task.setTrash(true);
assertTrue(this.task.isTrash());
}
// This test show a problem with putInTrash and restore but wont be fix
/*
@Test
public void testPutInTrashAndRestore() {
IProject p = new Project();
p.addTask(this.task);
this.task.setProjectContainer(p);
assertFalse(this.task.isTrash());
this.task.putInTrash();
assertTrue(this.task.isTrash());
this.task.restore();
assertFalse(this.task.isTrash());
}*/
@Test
public void testIsArchived() {
assertFalse(this.task.isArchived());
this.task.archive();
assertTrue(this.task.isArchived());
}
@Test
public void testContextAssociation() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment