Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mathieu GICQUEL
GTD Server
Commits
1c40402a
Commit
1c40402a
authored
Mar 31, 2021
by
Jean-Mael BOIS
Browse files
isTrash test - Fix
#31
isArchived test - Fix
#36
Continuity of the TaskTest test -
#38
parent
21f512b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
gtd-server-main/src/test/java/fr/alma/gtd/server/main/donnees/ProjectTest.java
View file @
1c40402a
...
...
@@ -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"
;
...
...
gtd-server-main/src/test/java/fr/alma/gtd/server/main/donnees/TaskTest.java
View file @
1c40402a
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
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment