Commit d57d0000 authored by Mathieu Gicquel's avatar Mathieu Gicquel
Browse files

Write tests to check association between task and user - Fix #15

parent 8cfacb84
package fr.alma.gtd.server.main.donnees;
import fr.alma.gtd.server.core.IParticipant;
import fr.alma.gtd.server.core.ITag;
import fr.alma.gtd.server.persistence.data.Utilisateur;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import javax.xml.registry.infomodel.User;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
......@@ -75,4 +79,19 @@ class TaskTest {
assertTrue(p1.getTasksList().contains(this.task));
assertTrue(p1.getTasksList().contains(task1));
}
@Test
public void testCreatorAssociation() {
IParticipant u1 = new Utilisateur();
IParticipant u2 = new Utilisateur();
this.task.setCreator(u1);
assertEquals(u1,this.task.getCreator());
this.task.setCreator(u2);
assertEquals(u2,this.task.getCreator());
}
}
\ No newline at end of file
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