コード例 #1
0
        public void StringToUOMTest()
        {
            string inStr = string.Empty;                                                            // TODO: Initialize to an appropriate value

            MapWindow.Interfaces.UnitOfMeasure expected = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            MapWindow.Interfaces.UnitOfMeasure actual;
            actual = Reports.StringToUOM(inStr);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #2
0
        public void GetScaleBarTest1()
        {
            MapWindow.Interfaces.Reports       target        = new MapWindow.Reports();                  // TODO: Initialize to an appropriate value
            MapWindow.Interfaces.UnitOfMeasure MapUnits      = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            MapWindow.Interfaces.UnitOfMeasure ScaleBarUnits = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            int MaxWidth = 0;                                                                            // TODO: Initialize to an appropriate value

            System.Drawing.Image expected = null;                                                        // TODO: Initialize to an appropriate value
            System.Drawing.Image actual;
            actual = target.GetScaleBar(MapUnits, ScaleBarUnits, MaxWidth);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #3
0
        public void ConvertUnitsTest()
        {
            ScaleBarUtility target = new ScaleBarUtility();                                          // TODO: Initialize to an appropriate value
            double          val    = 0F;                                                             // TODO: Initialize to an appropriate value

            MapWindow.Interfaces.UnitOfMeasure srcUnits  = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            MapWindow.Interfaces.UnitOfMeasure destUnits = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            double expected = 0F;                                                                    // TODO: Initialize to an appropriate value
            double actual;

            actual = target.ConvertUnits(val, srcUnits, destUnits);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #4
0
        public void DistanceTest()
        {
            ScaleBarUtility_Accessor target = new ScaleBarUtility_Accessor();                           // TODO: Initialize to an appropriate value
            double Lat1  = 0F;                                                                          // TODO: Initialize to an appropriate value
            double Long1 = 0F;                                                                          // TODO: Initialize to an appropriate value
            double Lat2  = 0F;                                                                          // TODO: Initialize to an appropriate value
            double Long2 = 0F;                                                                          // TODO: Initialize to an appropriate value

            MapWindow.Interfaces.UnitOfMeasure DesiredUnits = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            double expected = 0F;                                                                       // TODO: Initialize to an appropriate value
            double actual;

            actual = target.Distance(Lat1, Long1, Lat2, Long2, DesiredUnits);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #5
0
        public void CalcRangeTest()
        {
            ScaleBarUtility_Accessor target = new ScaleBarUtility_Accessor();                                    // TODO: Initialize to an appropriate value
            Extents MapExtents = null;                                                                           // TODO: Initialize to an appropriate value

            MapWindow.Interfaces.UnitOfMeasure MapUnits              = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            MapWindow.Interfaces.UnitOfMeasure ScaleBarUnits         = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            MapWindow.Interfaces.UnitOfMeasure ScaleBarUnitsExpected = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            int    width    = 0;                                                                                 // TODO: Initialize to an appropriate value
            double expected = 0F;                                                                                // TODO: Initialize to an appropriate value
            double actual;

            actual = target.CalcRange(MapExtents, MapUnits, ref ScaleBarUnits, width);
            Assert.AreEqual(ScaleBarUnitsExpected, ScaleBarUnits);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #6
0
        public void GenerateScaleBarTest()
        {
            ScaleBarUtility target     = new ScaleBarUtility();                                          // TODO: Initialize to an appropriate value
            Extents         MapExtents = null;                                                           // TODO: Initialize to an appropriate value

            MapWindow.Interfaces.UnitOfMeasure MapUnits      = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            MapWindow.Interfaces.UnitOfMeasure ScaleBarUnits = new MapWindow.Interfaces.UnitOfMeasure(); // TODO: Initialize to an appropriate value
            int   MaxWidth  = 0;                                                                         // TODO: Initialize to an appropriate value
            Color BackColor = new Color();                                                               // TODO: Initialize to an appropriate value
            Color ForeColor = new Color();                                                               // TODO: Initialize to an appropriate value

            System.Drawing.Image expected = null;                                                        // TODO: Initialize to an appropriate value
            System.Drawing.Image actual;
            actual = target.GenerateScaleBar(MapExtents, MapUnits, ScaleBarUnits, MaxWidth, BackColor, ForeColor);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #7
0
 /// <summary>
 /// Overloaded version - Computes the Euclidean distance between two points.
 /// </summary>
 /// <param name="x1">The first point.</param>
 /// <param name="x2">The second point.</param>
 /// <param name="y1">The first point.</param>
 /// <param name="y2">The second point.</param>
 /// <param name="Units">The units of the data (e.g., "Meters", "Lat/Long")</param>
 /// <returns>The distance between the first and second point, else 0 if an error was encountered.</returns>
 public static double DistancePointToPoint(double x1, double y1, double x2, double y2, MapWindow.Interfaces.UnitOfMeasure Units)
 {
     if (Units == MapWindow.Interfaces.UnitOfMeasure.DecimalDegrees)
     {
         return(LLDistance(y1, x1, y2, x2));
     }
     else
     {
         return(Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2)));
     }
 }