Class LineSegment2dTest


  • public class LineSegment2dTest
    extends Object
    Segment2dTest.java.

    Copyright (c) 2020-2021 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See DJUTILS License.

    Author:
    Alexander Verbraeck, Peter Knoppers
    • Constructor Detail

      • LineSegment2dTest

        public LineSegment2dTest()
    • Method Detail

      • constructorTest

        public void constructorTest()
        Test the constructors.
      • verifySegment

        public void verifySegment​(String description,
                                  LineSegment2d segment,
                                  double expectedStartX,
                                  double expectedStartY,
                                  double expectedEndX,
                                  double expectedEndY)
        Check that a segment has all the right values.
        Parameters:
        description - String; description of the test
        segment - Segment2d; the segment
        expectedStartX - double; the expected x value for the start of the segment
        expectedStartY - double; the expected y value for the start of the segment
        expectedEndX - double; the expected x value for the end of the segment
        expectedEndY - double; the expected y value for the end of the segment
      • locationTest

        public void locationTest()
        Test the getLocation methods.
      • closestPointOnSegmentTest

        public void closestPointOnSegmentTest()
        Test the closestPointOnSegment method.
      • testProject

        public void testProject()
        Test the project methods.
      • equalsAndHashCodeTest

        public void equalsAndHashCodeTest()
        Test the equals and hasCode methods.