Exemplo n.º 1
0
        public void DistanceBetweenPoints_SamePoint_ReturnsTrue()
        {
            // Arrange
            PointItem point = new PointItem(10, 10, 0);
            double    result;

            // Act
            result = point.DistanceBetweenPoints(point);

            // Assert
            Assert.AreEqual(result, 0);
        }
Exemplo n.º 2
0
        public void DistanceBetweenPoints_KnownDistance_ReturnsTrue()
        {
            // Arrange
            PointItem point  = new PointItem(10, 10, 0);
            PointItem point1 = new PointItem(0, 0, 0);
            double    result;
            double    knownDistance = 1568520.55679858;

            // Act
            result = point.DistanceBetweenPoints(point1);

            // Assert
            Assert.AreEqual(knownDistance, result, 0.00000001);
        }
Exemplo n.º 3
0
        public void DistanceBetweenPoints_FlipPoints_ReturnsTrue()
        {
            // Arrange
            PointItem point  = new PointItem(10, 10, 0);
            PointItem point1 = new PointItem(0, 0, 0);
            double    result;
            double    result1;

            // Act
            result  = point.DistanceBetweenPoints(point1);
            result1 = point1.DistanceBetweenPoints(point);

            // Assert
            Assert.AreEqual(result, result1);
        }