public void Distance(double x1, double y1, double x2, double y2, double expectedDistance)
        {
            Point2D point1 = new Point2D(x1, y1);
            Point2D point2 = new Point2D(x2, y2);

            double actualDistance = point1.DistanceTo(point2);

            Assert.That(TestUtil.IsSameValue(actualDistance, expectedDistance));
        }
        public void Perimeter(double radius, double centerX, double centerY, double expectedPerimeter)
        {
            Circle2D circle = new Circle2D(new Point2D(centerX, centerY), radius);

            Assert.That(TestUtil.IsSameValue(circle.Perimeter, expectedPerimeter));
        }
        public void Area(double radius, double centerX, double centerY, double expectedArea)
        {
            Circle2D circle = new Circle2D(new Point2D(centerX, centerY), radius);

            Assert.That(TestUtil.IsSameValue(circle.Area, expectedArea));
        }
Beispiel #4
0
        public void GetLength()
        {
            LineSegment2D lineSegment = new LineSegment2D(new Point2D(0, 0), new Point2D(10, 20));

            Assert.That(TestUtil.IsSameValue(lineSegment.Length, 22.3606798));
        }