Exemplo n.º 1
0
        public void GetNearestPoints_ShipInMiddle_ReturnsNearestPoints()
        {
            var ship = new Ship {
                Direction = ShipDirection.Horizontal, Hp = 4, Size = 4, Points = new List <Point>
                {
                    new Point(3, 3),
                    new Point(4, 3),
                    new Point(5, 3),
                    new Point(6, 3)
                }
            };

            var points = FieldGenerator.GetNearestPoints(ship.Points, 10);

            Assert.AreEqual(18, points.Count);
        }
Exemplo n.º 2
0
        public void GetNearestPoints_ShipInBeginning_ReturnNearestPointWithoutNegative()
        {
            var ship = new Ship
            {
                Direction = ShipDirection.Horizontal,
                Hp        = 4,
                Size      = 4,
                Points    = new List <Point>
                {
                    new Point(0, 0),
                    new Point(1, 0),
                    new Point(2, 0),
                    new Point(3, 0)
                }
            };

            var points = FieldGenerator.GetNearestPoints(ship.Points, 10);

            Assert.AreEqual(10, points.Count);
        }