Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
naomod
Object-Oriented Software Analysis and Design (OOAD)
Projet 2020 - Not Alone
Commits
14076775
Commit
14076775
authored
Nov 27, 2020
by
Thomas DENIS
Browse files
Ajout des tests pour HandCreature
parent
a805dc94
Changes
1
Hide whitespace changes
Inline
Side-by-side
not-alone-server/src/test/java/fr/univnantes/alma/game/item/hand/HandCreatureTest.java
View file @
14076775
package
fr.univnantes.alma.game.item.hand
;
import
fr.univnantes.alma.game.item.jeton.Jeton
;
import
fr.univnantes.alma.game.item.jeton.JetonArtemia
;
import
fr.univnantes.alma.game.item.jeton.JetonCible
;
import
fr.univnantes.alma.game.item.jeton.JetonCreature
;
import
org.junit.jupiter.api.Test
;
import
java.util.HashSet
;
import
java.util.Set
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
HandCreatureTest
{
//TODO tests
HandCreature
hand
=
new
HandCreature
();
@Test
public
void
testInitializationJeton
(){
Jeton
j1
=
new
JetonArtemia
();
Jeton
j2
=
new
JetonCreature
();
Jeton
j3
=
new
JetonCible
();
hand
.
initializationJeton
();
assertTrue
(
hand
.
getJetons
().
contains
(
j1
));
assertTrue
(
hand
.
getJetons
().
contains
(
j2
));
assertTrue
(
hand
.
getJetons
().
contains
(
j3
));
}
@Test
public
void
testPlayJeton
(){
Jeton
j1
=
new
JetonArtemia
();
hand
.
getJetons
().
add
(
j1
);
Jeton
result
=
hand
.
playJeton
(
j1
);
assertFalse
(
hand
.
getJetons
().
contains
(
j1
));
}
@Test
public
void
testPlayJetonSet
(){
Jeton
j1
=
new
JetonArtemia
();
Set
<
Jeton
>
testjetons
=
new
HashSet
<>();
testjetons
.
add
(
j1
);
hand
.
getJetons
().
add
(
j1
);
Set
<
Jeton
>
result
=
hand
.
playJeton
(
testjetons
);
assertFalse
(
hand
.
getJetons
().
containsAll
(
testjetons
));
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
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