Example #1
0
        public void ArcGisMapConstructorTest()
        {
            ArcGisMap target = new ArcGisMap();

            // Would this do?
            Assert.IsNotNull(target.Map.Layers);
            Assert.IsTrue(target.isDrawObjectCreated());
        }
Example #2
0
        public void AddBookmarkPinTest()
        {
            ArcGisMap target = new ArcGisMap();
            BookmarkPin pin = new BookmarkPin(new Point(100, 50));
            GraphicsLayer graphicsLayer = target.Map.Layers["BookmarksLayer"] as GraphicsLayer;
            int initialCount = graphicsLayer.Graphics.Count;
            target.AddBookmarkPin(pin);
            int finalCount = graphicsLayer.Graphics.Count;

            Assert.AreEqual(initialCount + 1, finalCount);
        }
Example #3
0
        /// <summary>
        /// Constructor for GhostFrame.
        /// Takes in a reference to the map where the 
        /// frame will be position, the evelope (extent) of
        /// the map that the frame covers, and the colour of
        /// the frame.
        /// </summary>
        /// <param name="backgroundMap">a reference to the background map where the frame will be position</param>
        /// <param name="mapEnvelope">the evelope (extent) of the map that the frame covers</param>
        /// <param name="color">the colour of the frame.</param>
        public GhostFrame(ArcGisMap backgroundMap, Envelope mapEnvelope, SolidColorBrush color)
        {
            InitializeComponent();

            //disable the flicking gesture
            this.Deceleration = double.NaN;

            parentMap = backgroundMap;
            mapExtent = mapEnvelope;

            ghostRectangle.Fill = color;
            ghostRectangle.Opacity = 0.5;

            MapPoint mpt1 = new MapPoint(mapEnvelope.XMin, mapEnvelope.YMax);
            MapPoint mpt4 = new MapPoint(mapEnvelope.XMax, mapEnvelope.YMin);
            // convert map points into screen coordinates
            Point pt1 = (parentMap).Map.MapToScreen(mpt1);
            Point pt2 = (parentMap).Map.MapToScreen(mpt4);

            this.Height = Math.Abs(pt1.Y - pt2.Y);
            this.Width = Math.Abs(pt1.X - pt2.X);

            Center = new Point(pt1.X + (pt2.X - pt1.X) / 2, pt1.Y + (pt2.Y - pt1.Y) / 2);
        }
Example #4
0
        public void PanToTest()
        {
            ArcGisMap target = new ArcGisMap();
            Point screenPoint = new Point(100, 20);
            target.PanTo(screenPoint);

            // Will this work? Theoretically the map should have this point as the center
            // TODO: figure out how to test this from the extent of the map
        }
Example #5
0
 public void ZoomTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     double factor = 0F; // TODO: Initialize to an appropriate value
     target.Zoom(factor);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Example #6
0
 public void ZoomToTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     //Geometry geom = null; // TODO: Initialize to an appropriate value
     //target.ZoomTo(geom);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Example #7
0
 public void StopDrawingTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     target.StopDrawing();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Example #8
0
 public void ZoomFactorTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     double actual;
     actual = target.ZoomFactor;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #9
0
 public void setIsBackgroundMapTest()
 {
     ArcGisMap target = new ArcGisMap();
     bool isBg = false;
     target.setIsABackgroundMap(isBg);
     Assert.AreEqual(target.isABackgroundMap(), isBg);
 }
Example #10
0
        public void setLinkedGhostFrameTest()
        {
            ArcGisMap target = new ArcGisMap();
            GhostFrame gf = new GhostFrame(BackgroundMapLayer.Instance.getBackgroundMap(), target.Extent, new SolidColorBrush(Colors.Red));
            target.LinkedGhostFrame = gf;

            Assert.AreEqual(gf, target.LinkedGhostFrame);
        }
Example #11
0
 public void CanZoomTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     target.CanZoom = expected;
     actual = target.CanZoom;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #12
0
 public void CenterTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     Point actual;
     actual = target.Center;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #13
0
 public void MapWidthTest()
 {
     ArcGisMap target = new ArcGisMap();
     double expected = 0F;
     double actual;
     target.MapWidth = expected;
     actual = target.MapWidth;
     Assert.AreEqual(expected, actual);
 }
Example #14
0
        public void ClearGraphicsTest()
        {
            ArcGisMap target = new ArcGisMap();
            target.ClearGraphics();
            GraphicsLayer graphicsLayer = target.Map.Layers["AnnotationsLayer"] as GraphicsLayer;

            int finalCount = graphicsLayer.Graphics.Count;
            Assert.AreEqual(finalCount, 0);
        }
Example #15
0
 public void MapURLTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     string actual;
     actual = target.MapURL;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #16
0
 public void MapTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     Map expected = null; // TODO: Initialize to an appropriate value
     Map actual;
     target.Map = expected;
     actual = target.Map;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #17
0
 public void InitialExtentTest()
 {
     ArcGisMap target = new ArcGisMap();
     Envelope expected = target.Map.Extent;
     Envelope actual;
     // setting should have been done in the constructor
     actual = target.InitialExtent;
     Assert.AreEqual(expected, actual);
 }
Example #18
0
 public void ExtentTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     Envelope actual;
     actual = target.Extent;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #19
0
        public void CreateBookmarkPinsTest()
        {
            ArcGisMap target = new ArcGisMap();
            List<Bookmark> bmrks = new List<Bookmark>();
            GraphicsLayer graphicsLayer = target.Map.Layers["BookmarksLayer"] as GraphicsLayer;
            int initialCount = graphicsLayer.Graphics.Count;

            bmrks.Add(new Bookmark(-114.165225251302, 51.0199795790397, -114.149512923988, 51.0355755135701, "Out of order lights", "0006780", Bookmark.BookmarkPriority.High));
            bmrks.Add(new Bookmark(-114.146822616181, 51.1247138317455, -114.12585847052, 51.1364297207226, "Repair Transformer", "0006889", Bookmark.BookmarkPriority.Medium));

            target.CreateBookmarkPins(bmrks);

            int finalCount = graphicsLayer.Graphics.Count;
            Assert.AreEqual(initialCount + 2, finalCount);
        }
Example #20
0
 public void CanPanTest()
 {
     ArcGisMap target = new ArcGisMap();
     bool expected = false;
     bool actual;
     target.CanPan = expected;
     actual = target.CanPan;
     Assert.AreEqual(expected, actual);
 }
Example #21
0
 public void setExtentFromEnvelopTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     Envelope input = null; // TODO: Initialize to an appropriate value
     target.setExtentFromEnvelop(input);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Example #22
0
 public void setExtentFromLtdLngTest()
 {
     ArcGisMap target = new ArcGisMap(); // TODO: Initialize to an appropriate value
     double lat = 0F; // TODO: Initialize to an appropriate value
     double lng = 0F; // TODO: Initialize to an appropriate value
     target.setExtentFromLtdLng(lat, lng);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Example #23
0
 public static void MyClassInitialize(TestContext testContext)
 {
     backgroundMap = new ArcGisMap();
 }