Пример #1
0
        public void DeberiaArrojarExcepcionSiLaNaveYaExisteEnElTablero()
        {
            var tablero = new Tablero();
            var lancha  = new Lancha(new Posicion('d', 5), Direccion.Este, tablero.GetAreaDePosicionesValidas());

            tablero.ColocarNave(lancha);

            tablero.ColocarNave(lancha);
        }
Пример #2
0
        public void DeberiaColocarNave()
        {
            var tablero = new Tablero();
            var lancha  = new Lancha(new Posicion('d', 5), Direccion.Este, tablero.GetAreaDePosicionesValidas());

            tablero.ColocarNave(lancha);

            Assert.AreSame(lancha, tablero.GetNaveEn(new Posicion('d', 5)));
            Assert.AreSame(lancha, tablero.GetNaveEn(new Posicion('e', 5)));
        }
Пример #3
0
        public void DeberiaArrojarExcepcionSiNaveAColocarEsNull()
        {
            var tablero = new Tablero();

            tablero.ColocarNave(null);
        }