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

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

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

            Assert.AreEqual(false, result);
        }
Beispiel #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);
        }