Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Not Alone
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony ROZEN
Not Alone
Commits
877fe54a
Commit
877fe54a
authored
Dec 23, 2020
by
babablaze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add CarteTest and PionTest. add methods in Plateau
parent
bed0818f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
2 deletions
+87
-2
not-alone-server/src/main/java/fr/univnantes/alma/game/composant/Plateau.java
.../main/java/fr/univnantes/alma/game/composant/Plateau.java
+12
-2
not-alone-server/src/test/java/fr/univnantes/alma/game/composant/Carte/CarteTest.java
...va/fr/univnantes/alma/game/composant/Carte/CarteTest.java
+44
-0
not-alone-server/src/test/java/fr/univnantes/alma/game/composant/Pion/PionTest.java
...java/fr/univnantes/alma/game/composant/Pion/PionTest.java
+31
-0
No files found.
not-alone-server/src/main/java/fr/univnantes/alma/game/composant/Plateau.java
View file @
877fe54a
...
...
@@ -65,7 +65,7 @@ public class Plateau {
return
reserve
;
}
public
Pion
Assimilation
getPionAssimilation
()
{
public
Pion
getPionAssimilation
()
{
return
pionAssimilation
;
}
...
...
@@ -73,11 +73,21 @@ public class Plateau {
this
.
pionAssimilation
.
setPosition
(
newPosition
);
}
public
Pion
Secours
getPionSecours
()
{
public
Pion
getPionSecours
()
{
return
pionSecours
;
}
public
void
setPionSecoursPosition
(
int
newPosition
)
{
this
.
pionSecours
.
setPosition
(
newPosition
);
}
@Override
public
String
toString
()
{
return
"Plateau{"
+
"plateauCarte="
+
plateauCarte
+
", reserve="
+
reserve
+
", pionAssimilation="
+
pionAssimilation
+
", pionSecours="
+
pionSecours
+
'}'
;
}
}
not-alone-server/src/test/java/fr/univnantes/alma/game/composant/Carte/CarteTest.java
View file @
877fe54a
package
fr.univnantes.alma.game.composant.Carte
;
import
fr.univnantes.alma.game.database.Lieux.Abri
;
import
fr.univnantes.alma.game.database.Survie.Adrenaline
;
import
fr.univnantes.alma.game.database.Traque.Acharnement
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
public
class
CarteTest
{
@BeforeEach
public
void
init
(){
Carte
carteLieux
=
new
Abri
();
Carte
carteSurvie
=
new
Adrenaline
();
Carte
carteTraque
=
new
Acharnement
();
}
@Test
public
void
testGetId
(){
CarteLieu
carteLieux
=
new
Abri
();
int
numero
=
7
;
String
nom
=
"Abri"
;
String
pouvoir
=
"..."
;
assertEquals
(
carteLieux
.
getNumero
(),
numero
);
assertEquals
(
carteLieux
.
getNom
(),
nom
);
assertEquals
(
carteLieux
.
getPouvoir
(),
pouvoir
);
}
@Test
public
void
testGetPhase
(){
CarteSurvie
carteSurvie
=
new
Adrenaline
();
int
phase
=
1
;
assertEquals
(
carteSurvie
.
getPhase
(),
phase
);
CarteTraque
carteTraque
=
new
Acharnement
();
int
phaseTraque
=
2
;
assertEquals
(
carteTraque
.
getPhase
(),
phaseTraque
);
}
@Test
public
void
testgetSymbole
(){
CarteTraque
carteTraque
=
new
Acharnement
();
String
symbole
=
""
;
assertEquals
(
carteTraque
.
getSymbole
(),
symbole
);
}
}
not-alone-server/src/test/java/fr/univnantes/alma/game/composant/Pion/PionTest.java
View file @
877fe54a
package
fr.univnantes.alma.game.composant.Pion
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertNotEquals
;
public
class
PionTest
{
@Test
public
void
testGetPosition
(){
Pion
pion
=
new
Pion
(
7
);
int
nombre
=
7
;
int
nombre2
=
3
;
assertEquals
(
pion
.
getPosition
(),
nombre
);
assertNotEquals
(
pion
.
getPosition
(),
nombre2
);
}
@Test
public
void
testSetPosition
(){
Pion
pion
=
new
Pion
(
7
);
pion
.
setPosition
(
3
);
int
nombre
=
7
;
int
nombre2
=
3
;
assertEquals
(
pion
.
getPosition
(),
nombre2
);
assertNotEquals
(
pion
.
getPosition
(),
nombre
);
}
@Test
public
void
testToString
(){
Pion
pion
=
new
Pion
(
7
);
String
message
=
"Pion{"
+
"position="
+
pion
.
getPosition
()
+
'}'
;
assertEquals
(
pion
.
toString
(),
message
);
}
}
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