public void GridPoint_ShouldNotBeAlive_WhenItGotShot()
        {
            // Arrange
            var gridPoint = new GridPoint(0, 0);

            // Act
            gridPoint.HitGridPoint();

            // Assert
            Assert.IsFalse(gridPoint.Alive);
        }
Ejemplo n.º 2
0
        public void Ship_ShouldBeDead_WhenAllGridPointsAreNotAlive()
        {
            // Arrange
            var shipType   = ShipType.Battleship;
            var gridPoint1 = new GridPoint(0, 0);
            var gridPoint2 = new GridPoint(0, 1);
            var gridPoint3 = new GridPoint(0, 2);
            var ship       = new Ship(shipType, new[] { gridPoint1, gridPoint2, gridPoint3 });

            // Act
            gridPoint1.HitGridPoint();
            gridPoint2.HitGridPoint();
            gridPoint3.HitGridPoint();

            // Assert
            Assert.IsTrue(ship.IsDead);
        }