예제 #1
0
        public void ToVector3D_Test()
        {
            // Arrange
            LocationTimeValue loc      = new LocationTimeValue(1, 1, 1);
            Vector3D          expected = new Vector3D(1, 1, 1);

            // Act
            Vector3D locPt3D = loc.ToVector3D();

            // Assert
            Assert.AreEqual(locPt3D, expected, "Calculation error.");
        }
예제 #2
0
        public void ToPoint3D_Test()
        {
            // Arrange
            LocationTimeValue loc      = new LocationTimeValue(1, 1, 1);
            Point3D           expected = new Point3D(1, 1, 1);

            // Act
            Point3D locPt3D = loc.ToPoint3D();

            // Assert
            Assert.AreEqual(locPt3D, expected, "Conversion error.");
        }
        public void EuclideanDistancePointExtensionMethod_Test()
        {
            // Arrange
            LocationTimeValue loc1 = new LocationTimeValue(0, 0, 0);
            LocationTimeValue loc2 = new LocationTimeValue(1, 1, 1);

            double expected = 1.732050808;

            // Act
            double dist = loc1.GetEuclideanDistance(loc2);

            // Assert
            Assert.AreEqual(dist, expected, 0.002, "Calculation error.");
        }
        public void EuclideanDistancePoint_Test()
        {
            // Arrange
            LocationTimeValue loc1 = new LocationTimeValue(0, 0, 0);
            LocationTimeValue loc2 = new LocationTimeValue(1, 1, 1);

            double expected = 1.732050808;

            // Act
            double dist = GeographyHelper.EuclideanDistance(loc1, loc2);


            // Assert
            Assert.AreEqual(dist, expected, 0.002, "Calculation error.");
        }
예제 #5
0
        public void GetMiddlePoint_Test()
        {
            // Arrange
            LocationTimeValue loc1 = new LocationTimeValue(1, 1, 1, "default", 1);
            LocationTimeValue loc2 = new LocationTimeValue(2, 2, 2, "default", 2);

            LocationTimeValue expected = new LocationTimeValue(1.5, 1.5, 1.5, "default", 1.5);

            // Act
            LocationTimeValue middle = loc1.GetMiddlePoint(loc2);

            // Assert
            Assert.AreEqual(expected.X, middle.X, 0.000001, "Calculation x failed");
            Assert.AreEqual(expected.Y, middle.Y, 0.000001, "Calculation y failed");
            Assert.AreEqual(expected.Z, middle.Z, 0.000001, "Calculation z failed");
            Assert.AreEqual(expected.Value[0], middle.Value[0], 0.000001, "Calculation value failed");
        }