Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Daniele Lucas
ItiAdventure
Commits
df269c13
Commit
df269c13
authored
Mar 12, 2021
by
Aroubate Hamza
Browse files
TP4
parent
dc1887c4
Changes
7
Hide whitespace changes
Inline
Side-by-side
ITIAdventure/srctest/fr/insarouen/asi/prog/asiaventure/TestMonde.java
View file @
df269c13
...
...
@@ -13,9 +13,7 @@ import fr.insarouen.asi.prog.asiaventure.EntiteDejaDansUnAutreMondeException;
import
static
org
.
hamcrest
.
core
.
Is
.
is
;
import
static
org
.
junit
.
Assert
.*;
/**
* JUnit Test de Monde.java
*/
public
class
TestMonde
{
private
Monde
monde
;
private
Entite
entite
;
...
...
@@ -26,9 +24,7 @@ public class TestMonde{
}
}
/**
*avantTest instancie les variables necessaires à l'exécution des différents tests
*/
@Before
public
void
avantTest
()
throws
NomDEntiteDejaUtiliseDansLeMondeException
,
EntiteDejaDansUnAutreMondeException
{
monde
=
new
Monde
(
"petitMonde"
);
...
...
@@ -41,25 +37,19 @@ public class TestMonde{
monde1
.
ajouter
(
entite
);
}
/**
*getNomTest teste la methode getNom de Monde
*/
@Test
public
void
getNomTest
(){
assertThat
(
monde
.
getNom
(),
IsEqual
.
equalTo
(
"petitMonde"
));
}
/**
*getEntiteTest teste la methode getEntite de Monde
*/
@Test
public
void
getEntiteTest
()
{
assertThat
(
monde
.
getEntite
(
"entite_style"
),
IsEqual
.
equalTo
(
entite
));
}
/**
*ajouterTest teste la methode ajouter de Monde
*/
@Test
public
void
ajouterTest
()
throws
NomDEntiteDejaUtiliseDansLeMondeException
,
EntiteDejaDansUnAutreMondeException
{
assertThat
(
monde
.
getEntite
(
"entite_non_style"
),
IsEqual
.
equalTo
(
null
));
...
...
ITIAdventure/srctest/fr/insarouen/asi/prog/asiaventure/elements/TestEntite.java
View file @
df269c13
...
...
@@ -13,9 +13,7 @@ import fr.insarouen.asi.prog.asiaventure.NomDEntiteDejaUtiliseDansLeMondeExcepti
import
static
org
.
hamcrest
.
core
.
Is
.
is
;
import
static
org
.
junit
.
Assert
.*;
/**
* JUnit Test de Entite.java
*/
public
class
TestEntite
{
private
Entite
entite
;
private
Monde
monde
;
...
...
@@ -26,9 +24,7 @@ public class TestEntite {
super
(
nom
,
monde
);
}
}
/**
*avantTest instancie les variables necessaires à l'exécution des différents tests
*/
@Before
public
void
avantTest
()
throws
NomDEntiteDejaUtiliseDansLeMondeException
{
nom
=
"mon_entite"
;
...
...
@@ -40,17 +36,12 @@ public class TestEntite {
public
void
ExceptionTest
()
throws
NomDEntiteDejaUtiliseDansLeMondeException
{
Entite
entite1
=
new
EntiteNA
(
nom
,
monde
);
}
/**
*getNomTest teste la methode getNom de Entite
*/
@Test
public
void
getNomTest
(){
assertThat
(
entite
.
getNom
(),
IsEqual
.
equalTo
(
nom
));
}
/**
*getMondeTest teste la methode getMonde de Entite
*/
@Test
public
void
getMondeTest
(){
assertThat
(
entite
.
getMonde
(),
IsEqual
.
equalTo
(
monde
));
...
...
ITIAdventure/srctest/fr/insarouen/asi/prog/asiaventure/elements/objets/AllTestObjets.java
0 → 100644
View file @
df269c13
package
fr.insarouen.asi.prog.asiaventure.elements.objets
;
import
org.junit.runners.Suite
;
import
org.junit.runners.Suite.SuiteClasses
;
import
org.junit.runner.RunWith
;
@RunWith
(
Suite
.
class
)
@Suite
.
SuiteClasses
({
})
public
class
AllTestObjets
{}
\ No newline at end of file
ITIAdventure/srctest/fr/insarouen/asi/prog/asiaventure/elements/structure/AllTestStructure.java
0 → 100644
View file @
df269c13
package
fr.insarouen.asi.prog.asiaventure.elements.structure
;
import
org.junit.runners.Suite
;
import
org.junit.runners.Suite.SuiteClasses
;
import
org.junit.runner.RunWith
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.TestPiece
;
@RunWith
(
Suite
.
class
)
@SuiteClasses
({
TestPiece
.
class
})
public
class
AllTestStructure
{}
\ No newline at end of file
ITIAdventure/srctest/fr/insarouen/asi/prog/asiaventure/elements/structure/TestPiece.java
0 → 100644
View file @
df269c13
ITIAdventure/srctest/fr/insarouen/asi/prog/asiaventure/elements/vivants/AllTestVivants.java
0 → 100644
View file @
df269c13
package
fr.insarouen.asi.prog.asiaventure.elements.vivants
;;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Suite
;
import
org.junit.runners.Suite.SuiteClasses
;
@RunWith
(
Suite
.
class
)
@Suite
.
SuiteClasses
({
TestVivant
.
class
})
public
class
AllTestVivant
{}
\ No newline at end of file
ITIAdventure/srctest/fr/insarouen/asi/prog/asiaventure/elements/vivants/TestVivant.java
0 → 100644
View file @
df269c13
package
fr.insarouen.asi.prog.asiaventure.elements.vivants
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Ignore
;
import
org.hamcrest.core.IsEqual
;
import
org.junit.Test
;
import
fr.insarouen.asi.prog.asiaventure.Monde
;
import
fr.insarouen.asi.prog.asiaventure.NomDEntiteDejaUtiliseDansLeMondeException
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.Objet
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.ObjetNonDeplacableException
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.ObjetAbsentDeLaPieceException
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.Piece
;
import
static
org
.
hamcrest
.
core
.
Is
.
is
;
import
static
org
.
junit
.
Assert
.*;
public
class
TestVivant
{
public
Monde
monde
;
public
Piece
piece
;
public
class
ObjetTest
extends
Objet
{
boolean
deplacable
;
public
ObjetTest
(
String
nom
,
Monde
monde
,
boolean
deplacable
)
throws
NomDEntiteDejaUtiliseDansLeMondeException
{
super
(
nom
,
monde
);
this
.
deplacable
=
deplacable
;
}
public
boolean
estDeplacable
()
{
return
this
.
deplacable
;
}
}
@Before
public
void
init
()
throws
Exception
{
monde
=
new
Monde
(
"un monde"
);
piece
=
new
Piece
(
"une piece"
,
monde
);
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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