Skip to content

Commit

Permalink
les tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedlouay committed Mar 7, 2021
1 parent b775719 commit bcec097
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 9 deletions.
36 changes: 28 additions & 8 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>
</dependencies>

</project>
2 changes: 1 addition & 1 deletion src/main/java/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public int getNbColonne() {


//lire le fichier map et creer un tableau 2d qui contient cette map
public static char[][] readMap(String fileName) throws IOException {
public char[][] readMap(String fileName) throws IOException {
Path path = Paths.get(fileName);
List<String> lignes = Files.readAllLines(path);
int n = lignes.size();
Expand Down
17 changes: 17 additions & 0 deletions src/test/java/GameSystemTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import org.junit.jupiter.api.Test;

public class GameSystemTest {


@Test
void userInputTest()
{

}

@Test
void playGameTest()
{

}
}
53 changes: 53 additions & 0 deletions src/test/java/MapTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.io.IOException;

public class MapTest {


Map map =new Map("map1.txt",new Player());

public MapTest() throws IOException {
}


@Test
void readMapTest() throws IOException {
char[][] vect =map.readMap("maps/map1.txt") ;
int nbLine = vect.length;
int nbColonne = vect[0].length;

for (int i = 0; i < nbLine; i++) {
Assertions.assertEquals('#', vect[i][0]);
Assertions.assertEquals('#', vect[i][nbColonne-1]);
Assertions.assertEquals('#', vect[0][i]);
Assertions.assertEquals('#', vect[nbLine-1][i]);
}
}

@Test
void setPositionTest ()
{

}
@Test
void movePlayerTest()
{

}
@Test
void tryMovePlayerTest()
{

}
@Test
void getTileTest()
{

}




}
11 changes: 11 additions & 0 deletions src/test/java/PlayerTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import org.junit.jupiter.api.Test;

public class PlayerTest {



@Test
void setPositionTest(int x , int y )
{}

}

0 comments on commit bcec097

Please sign in to comment.