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
47116e10
Commit
47116e10
authored
Dec 09, 2020
by
Killian LUCAS
Browse files
GameTest.java update
parent
f68cd501
Changes
1
Hide whitespace changes
Inline
Side-by-side
not-alone-server/src/test/java/fr/univnantes/alma/server/game/GameTest.java
View file @
47116e10
...
...
@@ -3,6 +3,7 @@ package fr.univnantes.alma.server.game;
import
fr.univnantes.alma.data.DatabaseFactory
;
import
fr.univnantes.alma.common.NotAloneDatabase
;
import
fr.univnantes.alma.server.game.item.Phase
;
import
fr.univnantes.alma.server.game.item.Reserve
;
import
fr.univnantes.alma.server.game.item.action.ActionChoosePower
;
import
fr.univnantes.alma.server.game.item.board.Board
;
import
fr.univnantes.alma.server.game.item.board.BoardColor
;
...
...
@@ -146,7 +147,7 @@ public class GameTest {
@Test
public
void
testGamePair_ErrorSup7
(){
Room
room
=
mock
(
Room
.
class
);
ArrayList
a
=
new
ArrayList
();
List
<
Pair
<
Integer
,
String
>>
a
=
new
ArrayList
();
a
.
add
(
new
Pair
(
1
,
"Natan"
));
a
.
add
(
new
Pair
(
2
,
"Odile"
));
a
.
add
(
new
Pair
(
3
,
"Tom tom"
));
...
...
@@ -155,7 +156,7 @@ public class GameTest {
a
.
add
(
new
Pair
(
6
,
"Oriane"
));
a
.
add
(
new
Pair
(
7
,
"Nana"
));
a
.
add
(
new
Pair
(
8
,
"Emilie"
));
assertThrows
(
IllegalArgumentException
.
class
,()->
new
Game
(
(
List
<
Pair
<
Integer
,
String
>>)
a
,
1
,
planet
,
board
,
room
));
assertThrows
(
IllegalArgumentException
.
class
,()->
new
Game
(
a
,
1
,
planet
,
board
,
room
));
}
@Test
public
void
testGamePair_ErrorEmpty
(){
...
...
@@ -165,20 +166,20 @@ public class GameTest {
@Test
public
void
testGamePair_ErrorIdCreature
(){
Room
room
=
mock
(
Room
.
class
);
ArrayList
a
=
new
ArrayList
();
List
<
Pair
<
Integer
,
String
>>
a
=
new
ArrayList
();
a
.
add
(
new
Pair
(
1
,
"Natan"
));
a
.
add
(
new
Pair
(
2
,
"Odile"
));
assertThrows
(
IllegalArgumentException
.
class
,()->
new
Game
(
(
List
<
Pair
<
Integer
,
String
>>)
a
,
3
,
planet
,
board
,
room
));
assertThrows
(
IllegalArgumentException
.
class
,()->
new
Game
(
a
,
3
,
planet
,
board
,
room
));
}
@Test
void
testGamePair
()
throws
TException
{
Room
room
=
mock
(
Room
.
class
);
ArrayList
a
=
new
ArrayList
();
a
.
add
(
new
Pair
(
1
,
"Natan"
));
a
.
add
(
new
Pair
(
2
,
"Odile"
));
Game
game
=
new
Game
((
List
<
Pair
<
Integer
,
String
>>)
a
,
1
,
planet
,
board
,
room
);
List
<
Pair
<
Integer
,
String
>>
a
=
new
ArrayList
(
Arrays
.
asList
(
new
Pair
(
1
,
"Natan"
),
new
Pair
(
2
,
"Odile"
)));
Game
game
=
new
Game
(
a
,
1
,
planet
,
board
,
room
);
game
.
getPlanet
().
forceMovePlanetPawn
();
Board
board
=
game
.
getBoard
();
assertEquals
(
new
Reserve
(
new
ArrayList
<
PlaceCard
>(
Arrays
.
asList
(
marais
,
abri
,
epave
,
source
,
artefact
)),
2
).
getPlaceCards
(),
game
.
getReserve
().
getPlaceCards
());
assertEquals
(
new
Score
(
7
,
13
),
board
.
getScore
());
board
.
moveForwardTraque
(
11
);
board
.
moveForwardCreature
(
6
);
...
...
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