Exemple #1
0
        public static void IndexOf_Returns_Index_of_Coordinate_if_Present()
        {
            List <CartesianCoordinate> coordinates = new List <CartesianCoordinate>()
            {
                new CartesianCoordinate(0, 0),
                new CartesianCoordinate(1, 2),
                new CartesianCoordinate(3, 4),
                new CartesianCoordinate(5, 6)
            };

            PointBoundary boundary = new PointBoundary(coordinates);

            // Present coordinate
            Assert.AreEqual(2, boundary.IndexOf(new CartesianCoordinate(3, 4)));

            // Non-present coordinate
            Assert.AreEqual(-1, boundary.IndexOf(new CartesianCoordinate(7, 8)));
        }