55import jwarrior .piezas .unidades .Orco ;
66import jwarrior .piezas .unidades .Unidad ;
77import jwarrior .piezas .unidades .mocks .UnidadStubBuilder ;
8+ import jwarrior .ui .InterfazDeUsuario ;
9+ import jwarrior .ui .mocks .SalidaMock ;
810
911import org .junit .Test ;
1012
@@ -13,41 +15,59 @@ public class PuntajeTests {
1315 @ Test
1416 public void alIniciarPuntajeComienzaConValorInicial () {
1517
16- Puntaje puntaje = new Puntaje ();
18+ Puntaje puntaje = new PuntajeMudo ();
1719 assertThat (puntaje .obtenerPuntaje (), is (10 ));
1820 }
1921
2022 @ Test
2123 public void alInformarPasoDeTurnoRestaPuntaje () {
2224
23- Puntaje puntaje = new Puntaje ();
25+ Puntaje puntaje = new PuntajeMudo ();
2426 puntaje .notificarTurno ();
2527 assertThat (puntaje .obtenerPuntaje (), is (9 ));
2628 }
2729
2830 @ Test
2931 public void alInformarMuerteEnemigoSumaSaludMaximaEnemigo () {
3032
31- Puntaje puntaje = new Puntaje ();
33+ Puntaje puntaje = new PuntajeMudo ();
3234 puntaje .notificarMuerteEnemigo (new Orco ());
3335 assertThat (puntaje .obtenerPuntaje (), is (18 ));
3436 }
3537
3638 @ Test
3739 public void alInformarFinalizacionPartidaSumaMitadDeSalud () {
3840
39- Puntaje puntaje = new Puntaje ();
41+ Puntaje puntaje = new PuntajeMudo ();
4042 puntaje .notificarFinalizacionPartida (UnidadStubBuilder .construirStubGuerrero ());
4143 assertThat (puntaje .obtenerPuntaje (), is (20 ));
4244 }
4345
4446 @ Test
4547 public void alInformarFinalizacionPartidaHeridoSumaMitadDeSalud () {
46- Puntaje puntaje = new Puntaje ();
48+ Puntaje puntaje = new PuntajeMudo ();
4749 Unidad guerrero = UnidadStubBuilder .construirStubGuerrero ();
4850 guerrero .recibirGolpe (4 );
4951
5052 puntaje .notificarFinalizacionPartida (guerrero );
5153 assertThat (puntaje .obtenerPuntaje (), is (18 ));
5254 }
55+
56+ @ Test
57+ public void puntajeEnviaMensaje () {
58+
59+ SalidaMock salida = new SalidaMock ();
60+ InterfazDeUsuario .establecerSalida (salida );
61+
62+ Puntaje puntaje = new Puntaje ();
63+ puntaje .notificarTurno ();
64+ assertThat (salida .envioMensaje (), is (true ));
65+ }
66+ }
67+
68+ class PuntajeMudo extends Puntaje {
69+ @ Override
70+ protected void mensaje (String mensaje ) {
71+ // No dice nada
72+ }
5373}
0 commit comments