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
Corentin GUILLEVIC
Not Alone
Commits
2f92ba78
Commit
2f92ba78
authored
Dec 11, 2020
by
Thomas DENIS
Browse files
Version 2 de HandTraqueTest
parent
d0d6a772
Changes
1
Hide whitespace changes
Inline
Side-by-side
not-alone-server/src/test/java/fr/univnantes/alma/server/game/item/player/hand/HandTraqueTest.java
View file @
2f92ba78
...
...
@@ -95,6 +95,115 @@ class HandTraqueTest {
public
void
testPlaceCardPlayedIsEmpty
(){
assertTrue
(
hand
.
placeCardPlayedIsEmpty
());
}
@Test
public
void
testThrowAwayPlaceCard
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
List
<
PlaceCard
>
testCards
=
new
ArrayList
<>();
testCards
.
add
(
card
);
hand
.
setPlaceCards
(
testCards
);
hand
.
playPlaceCard
(
testCards
);
assertTrue
(
hand
.
throwAwayPlaceCard
());
assertTrue
(
hand
.
getDefausse
().
containsAll
(
testCards
));
assertTrue
(
hand
.
getPlaceCardsPlayed
().
isEmpty
());
}
@Test
public
void
testThrowAwayPlaceCardGiven
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
List
<
PlaceCard
>
testCards
=
new
ArrayList
<>();
testCards
.
add
(
card
);
hand
.
setPlaceCards
(
testCards
);
assertTrue
(
hand
.
throwAwayPlaceCard
(
card
));
assertFalse
(
hand
.
getPlaceCards
().
contains
(
card
));
assertTrue
(
hand
.
getDefausse
().
contains
(
card
));
}
@Test
public
void
testThrowAwayPlaceCardList
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
List
<
PlaceCard
>
testCards
=
new
ArrayList
<>();
testCards
.
add
(
card
);
hand
.
setPlaceCards
(
testCards
);
assertTrue
(
hand
.
throwAwayPlaceCard
(
testCards
));
assertTrue
(
hand
.
getDefausse
().
containsAll
(
testCards
));
}
@Test
public
void
testTakeBackPlaceCard
(){
//TODO
}
@Test
public
void
testTakeBackPlaceCardGiven
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
List
<
PlaceCard
>
testCards
=
new
ArrayList
<>();
testCards
.
add
(
card
);
hand
.
setPlaceCards
(
testCards
);
hand
.
throwAwayPlaceCard
(
card
);
assertTrue
(
hand
.
takeBackPlaceCard
(
card
));
assertTrue
(
hand
.
getPlaceCards
().
contains
(
card
));
assertFalse
(
hand
.
getDefausse
().
contains
(
card
));
}
@Test
public
void
testTakeBackPlaceCardList
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
List
<
PlaceCard
>
testCards
=
new
ArrayList
<>();
testCards
.
add
(
card
);
hand
.
setPlaceCards
(
testCards
);
hand
.
throwAwayPlaceCard
(
testCards
);
assertTrue
(
hand
.
takeBackPlaceCard
(
testCards
));
assertTrue
(
hand
.
getPlaceCards
().
containsAll
(
testCards
));
}
@Test
public
void
testTakeBackPlayedPlaceCards
(){
//TODO
}
@Test
public
void
testTakeBackAllPlaceCardFromDefausse
(){
//TODO
}
@Test
public
void
testAddPlaceCard
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
assertTrue
(
hand
.
addPlaceCard
(
card
));
assertTrue
(
hand
.
getPlaceCards
().
contains
(
card
));
}
@Test
public
void
testAddPlaceCardList
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
List
<
PlaceCard
>
testCards
=
new
ArrayList
<>();
testCards
.
add
(
card
);
assertTrue
(
hand
.
addPlaceCard
(
testCards
));
assertTrue
(
hand
.
getPlaceCards
().
containsAll
(
testCards
));
}
@Test
public
void
testAddPlaceCardInDefausse
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
assertTrue
(
hand
.
addPlaceCardInDefausse
(
card
));
assertTrue
(
hand
.
getDefausse
().
contains
(
card
));
}
@Test
public
void
testAddPlaceCardListInDefausse
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
List
<
PlaceCard
>
testCards
=
new
ArrayList
<>();
testCards
.
add
(
card
);
assertTrue
(
hand
.
addPlaceCardInDefausse
(
testCards
));
assertTrue
(
hand
.
getDefausse
().
containsAll
(
testCards
));
}
@Test
public
void
testPlayPlaceCard
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
hand
.
addPlaceCard
(
card
);
assertTrue
(
hand
.
playPlaceCard
(
card
));
assertTrue
(
hand
.
getPlaceCardsPlayed
().
contains
(
card
));
assertFalse
(
hand
.
getPlaceCards
().
contains
(
card
));
}
@Test
public
void
testPlayPlaceCardList
(){
PlaceCard
card
=
new
PlaceCard
(
CardName
.
ANTRE
,
"antre"
,
"antre"
,
1
,
"url"
,
"bleu"
);
List
<
PlaceCard
>
testCards
=
new
ArrayList
<>();
testCards
.
add
(
card
);
hand
.
addPlaceCard
(
testCards
);
assertTrue
(
hand
.
playPlaceCard
(
testCards
));
assertTrue
(
hand
.
getPlaceCardsPlayed
().
containsAll
(
testCards
));
assertFalse
(
hand
.
getPlaceCards
().
containsAll
(
testCards
));
}
/* SurvivalCards Methods */
...
...
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