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
naomod
Object-Oriented Software Analysis and Design (OOAD)
Projet 2020 - Not Alone
Commits
006271ad
Commit
006271ad
authored
Dec 11, 2020
by
Thomas DENIS
Browse files
Correction des test dans HandCreatureTest
parent
62263f09
Changes
1
Hide whitespace changes
Inline
Side-by-side
not-alone-server/src/test/java/fr/univnantes/alma/server/game/item/player/hand/HandCreatureTest.java
View file @
006271ad
package
fr.univnantes.alma.server.game.item.player.hand
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertFalse
;
import
fr.univnantes.alma.server.game.item.jeton.JetonSymbol
;
import
java.util.ArrayList
;
import
java.util.List
;
class
HandCreatureTest
{
/*
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));
assertTrue
(
hand
.
getJetonSymbols
().
contains
(
JetonSymbol
.
ARTEMIA
));
assertTrue
(
hand
.
getJetonSymbols
().
contains
(
JetonSymbol
.
CREATURE
));
assertTrue
(
hand
.
getJetonSymbols
().
contains
(
JetonSymbol
.
CIBLE
));
assertTrue
(
hand
.
getJetonSymbolsPlayed
().
isEmpty
());
}
@Test
public
void
testPlayJeton
(){
Jeton j1 = new JetonArtemia();
hand.getJetons().add(j1);
Jeton result = hand.playJeton(j1);
assertFalse(hand.getJetons().contains(j1));
JetonSymbol
j1
=
JetonSymbol
.
ARTEMIA
;
boolean
result
=
hand
.
playJeton
(
j1
);
assertTrue
(
result
);
assertFalse
(
hand
.
getJetonSymbols
().
contains
(
j1
));
assertTrue
(
hand
.
getJetonSymbolsPlayed
().
contains
(
j1
));
}
@Test
public
void
testPlayJetonSet
(){
Jeton j1 =
new
Jeton
Artemia()
;
Se
t<Jeton> testjetons = new
HashSe
t<>();
Jeton
Symbol
j1
=
Jeton
Symbol
.
ARTEMIA
;
Lis
t
<
Jeton
Symbol
>
testjetons
=
new
ArrayLis
t
<>();
testjetons
.
add
(
j1
);
hand.getJetons().add(j1);
Set<Jeton> result = hand.playJeton(testjetons);
assertFalse(hand.getJetons().containsAll(testjetons));
hand
.
getJetonSymbols
().
add
(
j1
);
boolean
result
=
hand
.
playJeton
(
testjetons
);
assertTrue
(
result
);
assertFalse
(
hand
.
getJetonSymbols
().
containsAll
(
testjetons
));
assertTrue
(
hand
.
getJetonSymbolsPlayed
().
containsAll
(
testjetons
));
}
*/
}
\ No newline at end of file
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