-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c57febf
commit d7f4533
Showing
5 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,76 @@ | ||
import pepita.* | ||
import muros.* | ||
import wollok.game.* | ||
import jugador.* | ||
import puntos.* | ||
import niveles.* | ||
|
||
describe "group of tests for pepita" { | ||
describe "gruop of test for the map"{ | ||
|
||
test "pepita has initial energy" { | ||
assert.equals(100, pepita.energy()) | ||
method initialize(){ | ||
game.clear() | ||
game.cellSize(40) | ||
game.height(18) | ||
game.width(18) | ||
game.start() | ||
nivel_1.iniciar_mapa() | ||
} | ||
|
||
|
||
|
||
test "Well allocated blocks on the map"{ | ||
assert.that(game.getObjectsIn(game.at(2, 2)).get(0).soyBloque()) | ||
assert.that(game.getObjectsIn(game.at(2, 3)).get(0).soyBloque()) | ||
assert.notThat(game.getObjectsIn(game.at(0, 0)).get(0).soyBloque()) | ||
} | ||
|
||
test "Well allocated fruits on the map"{ | ||
assert.equals(10, game.allVisuals().count({element => element.esFruta()})) | ||
} | ||
|
||
|
||
} | ||
|
||
describe "group of tests for the player" { | ||
|
||
const jugador = new Jugador() | ||
|
||
method initialize(){ | ||
game.clear() | ||
game.cellSize(40) | ||
game.height(18) | ||
game.width(18) | ||
game.start() | ||
jugador.posicionate() | ||
} | ||
|
||
test "Player spaw is correct" { | ||
assert.equals(game.at(1, 1), jugador.position()) | ||
} | ||
|
||
test "Player collides to the left wall"{ | ||
jugador.position(game.at(0, 1)) | ||
assert.equals(game.at(1, 1), jugador.position()) | ||
} | ||
|
||
test "Player collides to the right wall"{ | ||
jugador.position(game.at(20, 1)) | ||
assert.equals(game.at(1, 1), jugador.position()) | ||
} | ||
|
||
test "Player collides to the top wall"{ | ||
jugador.position(game.at(1, 20)) | ||
assert.equals(game.at(1, 1), jugador.position()) | ||
} | ||
|
||
test "Player collides to the bottom wall"{ | ||
jugador.position(game.at(1, 0)) | ||
assert.equals(game.at(1, 1), jugador.position()) | ||
} | ||
|
||
/*test "Player can pick up a fruit"{ | ||
var fruta = new Fruta() | ||
fruta.ubicarYDibujar(game.at(1, 1)) | ||
assert.equals(2, jugador.position()) | ||
}*/ | ||
|
||
} |