Exemplo n.º 1
0
        public void HitVerticalShip()
        {
            var ship   = new Destroyer(Direction.Vertical, 1, 1);
            var result = ship.Attack(1, 2);

            Assert.AreEqual(true, result);
        }
Exemplo n.º 2
0
        public void MissVerticalShip()
        {
            var ship   = new Destroyer(Direction.Vertical, 1, 1);
            var result = ship.Attack(2, 1);

            Assert.AreEqual(false, result);
        }
Exemplo n.º 3
0
        public void MissHorizontalShip()
        {
            var ship   = new Destroyer(Direction.Horizontal, 1, 1);
            var result = ship.Attack(3, 1);

            Assert.AreEqual(false, result);
        }
Exemplo n.º 4
0
        public void NotDestroyShip()
        {
            var ship = new Destroyer(Direction.Horizontal, 1, 1);

            ship.Attack(1, 1);

            var result = ship.IsDestroyed;

            Assert.AreEqual(false, result);
        }