public void TestLopezReggaeColocaUnaBombaMolotovYContinuaMoviendoseAlejandoseDelExplosivo()
        {
            Casilla posicion = Tablero.GetInstancia().Casilla(2, 2);
            lopezReggae = new LopezReggae(posicion);
            lopezReggae.LanzarExplosivo();

            // asserts
            Assert.IsTrue(posicion.TieneBomba());
            Assert.IsTrue(posicion.TienePersonaje());

            lopezReggae.MoverAlEste();
            lopezReggae.MoverAlEste();
            lopezReggae.MoverAlNorte();

            // asserts
            Assert.IsTrue(posicion.TieneBomba());
            Assert.IsFalse(posicion.TienePersonaje());
            Assert.AreEqual(lopezReggae.Posicion().X, 1);
            Assert.AreEqual(lopezReggae.Posicion().Y, 6);
        }
Exemplo n.º 2
0
        public void TestCecilioColocaUnaBombaMolotovYContinuaMoviendoseAlejandoseDelExplosivo()
        {
            Casilla posicion = Tablero.GetInstancia().Casilla(1, 1);
            cecilio = new Cecilio(posicion);
            cecilio.LanzarExplosivo();

            // asserts
            Assert.IsTrue(posicion.TieneBomba());
            Assert.IsTrue(posicion.TienePersonaje());

            cecilio.MoverAlSur();
            cecilio.MoverAlEste();

            // asserts
            Assert.IsTrue(posicion.TieneBomba());
            Assert.IsFalse(posicion.TienePersonaje());
            Assert.AreEqual(cecilio.Posicion().X, 2);
            Assert.AreEqual(cecilio.Posicion().Y, 2);

            // limpia el tablero
            Tablero.Vaciar();
        }
        public void TestLopezReggaeAladoSeMueveHacialaIzquierda()
        {
            lopezReggaeAlado = new LopezReggaeAlado(Tablero.GetInstancia().Casilla(2, 2));
            lopezReggaeAlado.MoverAlOeste();

            // asserts
            Assert.AreEqual(lopezReggaeAlado.Posicion().X, 2);
            Assert.AreEqual(lopezReggaeAlado.Posicion().Y, 1);

            // limpia el tablero
            Tablero.Vaciar();
        }
        public void TestLopezReggaeAladoPasaPorSobreUnObstaculo()
        {
            lopezReggaeAlado = new LopezReggaeAlado(Tablero.GetInstancia().Casilla(1, 1));
            Obstaculo obstaculo = new ObstaculoDeCemento(Tablero.GetInstancia().Casilla(1, 2));

            lopezReggaeAlado.MoverAlEste();

            // asserts
            // en la misma posicion que el obstaculo
            Assert.AreEqual(lopezReggaeAlado.Posicion().X, 1);
            Assert.AreEqual(lopezReggaeAlado.Posicion().Y, 2);

            lopezReggaeAlado.MoverAlEste();

            // asserts
            // paso por encima del obstaculo
            Assert.AreEqual(lopezReggaeAlado.Posicion().X, 1);
            Assert.AreEqual(lopezReggaeAlado.Posicion().Y, 3);

            // limpia el tablero
            Tablero.Vaciar();
        }
        public void TestLopezReggaeSeMueveHaciaLaDerecha()
        {
            lopezReggae = new LopezReggae(Tablero.GetInstancia().Casilla(2, 2));
            lopezReggae.MoverAlEste();

            // asserts
            Assert.AreEqual(lopezReggae.Posicion().X, 2);
            Assert.AreEqual(lopezReggae.Posicion().Y, 4);

            // limpia el tablero
            Tablero.Vaciar();
        }
        public void TestLopezReggaeNoSePuedeMoverPorqueHayUnObstaculo()
        {
            lopezReggae = new LopezReggae(Tablero.GetInstancia().Casilla(2, 2));
            Obstaculo obstaculo = new ObstaculoDeCemento(Tablero.GetInstancia().Casilla(1, 2));

            lopezReggae.MoverAlNorte();

            // asserts
            Assert.AreEqual(lopezReggae.Posicion().X, 2);
            Assert.AreEqual(lopezReggae.Posicion().Y, 2);

            // limpia el tablero
            Tablero.Vaciar();
        }
Exemplo n.º 7
0
        public void TestCecilioSeMueveHaciaLaIzquierda()
        {
            cecilio = new Cecilio(Tablero.GetInstancia().Casilla(2, 2));
            cecilio.MoverAlOeste();

            // asserts
            Assert.AreEqual(cecilio.Posicion().X, 2);
            Assert.AreEqual(cecilio.Posicion().Y, 1);

            // limpia el tablero
            Tablero.Vaciar();
        }
Exemplo n.º 8
0
        public void TestCecilioNoSePuedeMoverPorqueHayUnObstaculo()
        {
            cecilio = new Cecilio(Tablero.GetInstancia().Casilla(2, 2));
            Obstaculo obstaculo = new ObstaculoDeLadrillo(Tablero.GetInstancia().Casilla(2, 1));

            cecilio.MoverAlOeste();

            // asserts
            Assert.AreEqual(cecilio.Posicion().X, 2);
            Assert.AreEqual(cecilio.Posicion().Y, 2);

            // limpia el tablero
            Tablero.Vaciar();
        }