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
7886e8ec
Commit
7886e8ec
authored
Dec 17, 2020
by
Killian LUCAS
Browse files
GameTest.java ajout de test
parent
4758f342
Changes
1
Show whitespace changes
Inline
Side-by-side
not-alone-server/src/test/java/fr/univnantes/alma/server/game/GameTest.java
View file @
7886e8ec
...
@@ -239,6 +239,7 @@ class GameTest {
...
@@ -239,6 +239,7 @@ class GameTest {
}
}
@Test
@Test
void
testTraqueCanPickSurvivalCards
()
{
void
testTraqueCanPickSurvivalCards
()
{
Room
room
=
mock
(
Room
.
class
);
Room
room
=
mock
(
Room
.
class
);
...
@@ -309,7 +310,7 @@ class GameTest {
...
@@ -309,7 +310,7 @@ class GameTest {
}
}
@Test
@Test
void
testPlayerResist_
p
hase2
()
{
void
testPlayerResist_
falseP
hase2
()
{
Room
room
=
mock
(
Room
.
class
);
Room
room
=
mock
(
Room
.
class
);
List
<
Pair
<
Integer
,
String
>>
list
=
new
ArrayList
<>(
Arrays
.
asList
(
new
Pair
<>(
1
,
"Nathan"
),
new
Pair
<>(
2
,
"Odile"
)));
List
<
Pair
<
Integer
,
String
>>
list
=
new
ArrayList
<>(
Arrays
.
asList
(
new
Pair
<>(
1
,
"Nathan"
),
new
Pair
<>(
2
,
"Odile"
)));
Game
game
=
new
Game
(
list
,
1
,
planet
,
board
,
room
);
Game
game
=
new
Game
(
list
,
1
,
planet
,
board
,
room
);
...
@@ -327,6 +328,44 @@ class GameTest {
...
@@ -327,6 +328,44 @@ class GameTest {
assertEquals
(
response
,
game
.
playerResist
(
2
,
2
));
assertEquals
(
response
,
game
.
playerResist
(
2
,
2
));
}
}
@Test
@Test
void
testPlayerResist_falseCreature
()
{
Room
room
=
mock
(
Room
.
class
);
List
<
Pair
<
Integer
,
String
>>
list
=
new
ArrayList
<>(
Arrays
.
asList
(
new
Pair
<>(
1
,
"Nathan"
),
new
Pair
<>(
2
,
"Odile"
)));
Game
game
=
new
Game
(
list
,
1
,
planet
,
board
,
room
);
//Start phase 1
game
.
startNextPhase
();
Response
response
=
new
Response
(
false
,
"Only traque can resist"
);
assertEquals
(
response
,
game
.
playerResist
(
1
,
2
));
}
@Test
void
testPlayerResist_falseCantResistThisRound
()
{
Room
room
=
mock
(
Room
.
class
);
List
<
Pair
<
Integer
,
String
>>
list
=
new
ArrayList
<>(
Arrays
.
asList
(
new
Pair
<>(
1
,
"Nathan"
),
new
Pair
<>(
2
,
"Odile"
)));
Game
game
=
new
Game
(
list
,
1
,
planet
,
board
,
room
);
game
.
getCreature
().
getTrackingCardHand
().
clear
();
game
.
getCreature
().
getTrackingCardHand
().
add
(
angoisse
);
Response
response
=
new
Response
(
true
,
""
);
assertTrue
(
game
.
creatureCanPlayThisTrackingCards
(
game
.
getCreature
(),
angoisse
));
assertEquals
(
response
,
game
.
creaturePlayTrackingCard
(
game
.
getCreature
(),
angoisse
));
game
.
startNextPhase
();
Response
response2
=
new
Response
(
false
,
"You can't resist for this round"
);
assertEquals
(
response2
,
game
.
playerResist
(
2
,
2
));
}
@Test
void
testPlayerResist_false
()
{
Room
room
=
mock
(
Room
.
class
);
List
<
Pair
<
Integer
,
String
>>
list
=
new
ArrayList
<>(
Arrays
.
asList
(
new
Pair
<>(
1
,
"Nathan"
),
new
Pair
<>(
2
,
"Odile"
)));
Game
game
=
new
Game
(
list
,
1
,
planet
,
board
,
room
);
//Start phase 1
game
.
startNextPhase
();
game
.
getTraques
().
get
(
0
).
setCanResist
(
false
);
Response
response
=
new
Response
(
false
,
"You can't resist"
);
assertEquals
(
response
,
game
.
playerResist
(
2
,
2
));
}
@Test
void
testPlayerResist_true
()
{
void
testPlayerResist_true
()
{
Room
room
=
mock
(
Room
.
class
);
Room
room
=
mock
(
Room
.
class
);
List
<
Pair
<
Integer
,
String
>>
list
=
new
ArrayList
<>(
Arrays
.
asList
(
new
Pair
<>(
1
,
"Nathan"
),
new
Pair
<>(
2
,
"Odile"
)));
List
<
Pair
<
Integer
,
String
>>
list
=
new
ArrayList
<>(
Arrays
.
asList
(
new
Pair
<>(
1
,
"Nathan"
),
new
Pair
<>(
2
,
"Odile"
)));
...
@@ -673,12 +712,6 @@ class GameTest {
...
@@ -673,12 +712,6 @@ class GameTest {
game
.
creaturePlayTrackingCard
(
game
.
getCreature
(),
mutation
);
game
.
creaturePlayTrackingCard
(
game
.
getCreature
(),
mutation
);
// assertFalse(game.creatureCanPlayThisTrackingCards(game.getCreature(), Arrays.asList(acharnement, mutation)));
}
}
@Test
@Test
void
testGetIdPlayerTargetByTrackingCardAnticipation
()
throws
TException
{
void
testGetIdPlayerTargetByTrackingCardAnticipation
()
throws
TException
{
...
...
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