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
LI Qi
Bowling
Commits
57017304
Commit
57017304
authored
Feb 05, 2016
by
Qi LI
Browse files
use english words
parent
23c29eac
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/
jeu/Joueu
r.java
→
src/
game/Playe
r.java
View file @
57017304
package
jeu
;
package
game
;
import
java.util.List
;
public
class
Player
{
public
class
Joueur
{
private
String
name
;
private
final
String
name
;
public
Joueu
r
(
String
name
)
{
public
Playe
r
(
String
name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
}
}
...
...
src/game/Set.java
0 → 100644
View file @
57017304
package
game
;
import
java.util.List
;
public
class
Set
{
private
final
List
<
Player
>
players
;
public
Set
(
List
<
Player
>
players
)
{
this
.
players
=
players
;
}
public
int
getPlayerNumber
()
{
return
players
.
size
();
}
public
List
getPlayers
()
{
return
players
;
}
}
src/jeu/Partie.java
deleted
100644 → 0
View file @
23c29eac
package
jeu
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
Partie
{
List
<
Joueur
>
joueurs
;
public
Partie
()
{
this
.
joueurs
=
new
ArrayList
<
Joueur
>();
}
public
void
addJoueur
(
Joueur
j
)
{
joueurs
.
add
(
j
);
}
public
int
getJoueurNombre
()
{
return
joueurs
.
size
();
}
public
List
getJoueurs
()
{
return
joueurs
;
}
}
src/test/
t
est
Joueu
r.java
→
src/test/
T
est
Playe
r.java
View file @
57017304
package
test
;
package
test
;
import
jeu.Joueu
r
;
import
game.Playe
r
;
import
org.junit.Assert
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
org.junit.Test
;
public
class
t
est
Joueu
r
{
public
class
T
est
Playe
r
{
private
Joueur
joueu
r
;
private
Player
playe
r
;
private
String
name
;
private
String
name
;
public
t
est
Joueu
r
()
{
public
T
est
Playe
r
()
{
this
.
name
=
"Alice"
;
this
.
name
=
"Alice"
;
this
.
joueu
r
=
new
Joueu
r
(
name
);
this
.
playe
r
=
new
Playe
r
(
name
);
}
}
@Test
@Test
public
void
testJoueurConstructor
()
{
public
void
testJoueurConstructor
()
{
Assert
.
assertNotNull
(
joueu
r
);
Assert
.
assertNotNull
(
playe
r
);
Assert
.
assertEquals
(
name
,
joueu
r
.
getName
());
Assert
.
assertEquals
(
name
,
playe
r
.
getName
());
}
}
}
}
src/test/testPartie.java
deleted
100644 → 0
View file @
23c29eac
package
test
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.junit.Test
;
import
org.junit.Assert
;
import
jeu.Partie
;
import
jeu.Joueur
;
public
class
testPartie
{
private
Partie
partie
;
private
int
nomJoueur
;
private
Joueur
[]
joueurs
;
public
testPartie
()
{
this
.
partie
=
new
Partie
();
this
.
nomJoueur
=
3
;
this
.
joueurs
=
new
Joueur
[]
{
new
Joueur
(
"Alice"
),
new
Joueur
(
"Bob"
),
new
Joueur
(
"Charlie"
)};
for
(
int
i
=
0
;
i
<
joueurs
.
length
;
++
i
)
partie
.
addJoueur
(
joueurs
[
i
]);
}
@Test
public
void
testPartieConstructor
()
{
Assert
.
assertNotNull
(
partie
);
}
@Test
public
void
testPartieAddJoueur
()
{
//Assert.assertTrue(partie.getJoueurNombre() == nomJoueur);
Assert
.
assertEquals
(
partie
.
getJoueurNombre
(),
nomJoueur
);
List
<
Joueur
>
partieJoueurs
=
partie
.
getJoueurs
();
for
(
int
i
=
0
;
i
<
partieJoueurs
.
size
();
++
i
)
{
Assert
.
assertNotNull
(
partieJoueurs
.
get
(
i
));
Assert
.
assertEquals
(
joueurs
[
i
],
partieJoueurs
.
get
(
i
));
}
}
}
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