Exemple #1
0
        public void TestEspaña_Capital()
        {
            IBaseDatosGeografica miBaseDatosGeografica =
                IJuego.dameElJuego().baseDatosGeografica;
            IPais españa = miBaseDatosGeografica.getPais("España");

            Assert.AreEqual(españa.capital, "Madrid");
        }
Exemple #2
0
        public void TestEspaña_Nombre()
        {
            IBaseDatosGeografica miBaseDatosGeografica =
                IJuego.dameElJuego().baseDatosGeografica;
            IPais españa = miBaseDatosGeografica.getPais("España");

            Assert.AreEqual(españa.nombre, "España");
        }
Exemple #3
0
        public void TestAltaJugador()
        {
            IBaseDatosJugadores miBaseDatosJugadores =
                IJuego.dameElJuego().baseDatosJugadores;
            IJugador ivan = miBaseDatosJugadores.nuevoJugador("Ivan");

            Assert.IsNotNull(ivan);
        }
Exemple #4
0
        public void TestRecuperarListaPartidas()
        {
            IBaseDatosJugadores miBaseDatosJugadores =
                IJuego.dameElJuego().baseDatosJugadores;
            IJugador ivan = miBaseDatosJugadores.getOrCreateJugador("Ivan");

            Assert.IsNotNull(ivan.historicoPartidas);
        }
Exemple #5
0
        public void TestAltaYRecuperacionJugador()
        {
            IBaseDatosJugadores miBaseDatosJugadores =
                IJuego.dameElJuego().baseDatosJugadores;
            IJugador ivan = miBaseDatosJugadores.getOrCreateJugador("Ivan");

            Assert.IsNotNull(ivan);
        }
Exemple #6
0
        public void TestNombreJugador()
        {
            IBaseDatosJugadores miBaseDatosJugadores =
                IJuego.dameElJuego().baseDatosJugadores;
            IJugador ivan = miBaseDatosJugadores.getOrCreateJugador("Ivan");

            Assert.AreEqual(ivan.nombre, "Ivan");
        }
Exemple #7
0
        public void TestEuropa_Paises()
        {
            IBaseDatosGeografica miBaseDatosGeografica =
                IJuego.dameElJuego().baseDatosGeografica;
            IContinente europa = miBaseDatosGeografica.getContinente("Europa");

            Assert.AreNotEqual(europa.paises.Count, 0);
        }
Exemple #8
0
        public void TestEuropa_Nombre()
        {
            IBaseDatosGeografica miBaseDatosGeografica =
                IJuego.dameElJuego().baseDatosGeografica;
            IContinente europa = miBaseDatosGeografica.getContinente("Europa");

            Assert.AreEqual(europa.nombre, "Europa");
        }
Exemple #9
0
        public void TestEspaña_Continente()
        {
            IBaseDatosGeografica miBaseDatosGeografica =
                IJuego.dameElJuego().baseDatosGeografica;
            IPais       españa = miBaseDatosGeografica.getPais("España");
            IContinente europa = miBaseDatosGeografica.getContinente("Europa");

            Assert.AreEqual(españa.continente, europa);
        }
Exemple #10
0
        public void TestEuropa_España()
        {
            IBaseDatosGeografica miBaseDatosGeografica =
                IJuego.dameElJuego().baseDatosGeografica;
            IContinente europa = miBaseDatosGeografica.getContinente("Europa");
            IPais       españa = europa.getPais("España");

            Assert.IsNotNull(españa);
        }
Exemple #11
0
        public void TestNuevaPartida1()
        {
            IBaseDatosJugadores miBaseDatosJugadores =
                IJuego.dameElJuego().baseDatosJugadores;
            IJugador    ivan    = miBaseDatosJugadores.getOrCreateJugador("Ivan");
            IContinente europa  = IJuego.dameElJuego().baseDatosGeografica.getContinente("Europa");
            IPartida    partida = ivan.nuevaPartida(europa);

            Assert.IsNotNull(partida);
        }
Exemple #12
0
        public void TestEuropa_Nueva_Zelanda()
        {
            IBaseDatosGeografica miBaseDatosGeografica =
                IJuego.dameElJuego().baseDatosGeografica;
            IContinente europa = miBaseDatosGeografica.getContinente("Europa");


            Assert.ThrowsException <KeyNotFoundException>(
                () => europa.getPais("Nueva Zelanda")
                );
        }
Exemple #13
0
        public void TestRespuestaCorrecta()
        {
            IBaseDatosJugadores miBaseDatosJugadores =
                IJuego.dameElJuego().baseDatosJugadores;
            IJugador    ivan      = miBaseDatosJugadores.getOrCreateJugador("Ivan");
            IContinente europa    = IJuego.dameElJuego().baseDatosGeografica.getContinente("Europa");
            IPartida    partida   = ivan.nuevaPartida(europa);
            IPregunta   pregunta  = partida.nuevaPregunta();
            bool        resultado = pregunta.proponerRespuesta(pregunta.pais.capital);

            Assert.IsTrue(resultado);
        }
Exemple #14
0
        public void TestNuevaPartida2()
        {
            IBaseDatosJugadores miBaseDatosJugadores =
                IJuego.dameElJuego().baseDatosJugadores;
            IJugador ivan = miBaseDatosJugadores.getOrCreateJugador("Ivan");

            int cuantasLlevaba = ivan.historicoPartidas.Count;

            IContinente europa  = IJuego.dameElJuego().baseDatosGeografica.getContinente("Europa");
            IPartida    partida = ivan.nuevaPartida(europa);

            int cuantasLleva = ivan.historicoPartidas.Count;

            Assert.AreEqual(cuantasLlevaba + 1, cuantasLleva);
            Assert.AreEqual(ivan.historicoPartidas[ivan.historicoPartidas.Count - 1], partida);
        }
Exemple #15
0
        public void TestRespuestasFallidasMultiples()
        {
            IBaseDatosJugadores miBaseDatosJugadores =
                IJuego.dameElJuego().baseDatosJugadores;
            IJugador    ivan     = miBaseDatosJugadores.getOrCreateJugador("Ivan");
            IContinente europa   = IJuego.dameElJuego().baseDatosGeografica.getContinente("Europa");
            IPartida    partida  = ivan.nuevaPartida(europa);
            IPregunta   pregunta = partida.nuevaPregunta();
            int         intentos = pregunta.intentosRestantes;

            Assert.AreEqual(intentos, 3);

            pregunta.proponerRespuesta("Ruina");
            pregunta.proponerRespuesta("Ruina");
            pregunta.proponerRespuesta("Ruina");

            intentos = pregunta.intentosRestantes;
            Assert.AreEqual(intentos, 0);

//            pregunta.proponerRespuesta("Ruina");
        }
 public void SetEstrategia(IJuego juegostrategy)
 {
     this._juegostrategy = juegostrategy;
 }