예제 #1
0
        public void Update_MapPointDataWithTestProperties_MapPointDataLayerUpdatedAccordingly()
        {
            // Setup
            Color color        = Color.AliceBlue;
            var   mapPointData = new MapPointData("Test name", new PointStyle
            {
                Color           = color,
                Size            = 4,
                Symbol          = PointSymbol.Circle,
                StrokeColor     = color,
                StrokeThickness = 1
            });
            var mapPointDataLayer = new MapPointDataLayer(mapPointData);

            SetMapPointDataTestProperties(mapPointData);

            // Precondition
            AssertMapPointDataLayerDefaultProperties(mapPointDataLayer);

            // Call
            mapPointDataLayer.Update();

            // Assert
            AssertMapPointDataLayerTestProperties(mapPointDataLayer);
        }
예제 #2
0
        public void GivenMapPointDataLayer_WhenUpdatedAfterMapPointDataFeaturesChanged_MapPointDataLayerFeaturesChanged()
        {
            // Given
            var mapPointData = new MapPointData("Test name")
            {
                Features = new[]
                {
                    CreateTestMapFeature()
                }
            };

            var mapPointDataLayer = new MapPointDataLayer(mapPointData);

            IFeature[] drawnFeatures = mapPointDataLayer.DataSet.Features.ToArray();

            // When
            mapPointData.Features = new[]
            {
                CreateTestMapFeature()
            };
            mapPointDataLayer.Update();

            // Then
            CollectionAssert.AreNotEqual(drawnFeatures, mapPointDataLayer.DataSet.Features);
        }
예제 #3
0
        private static void AssertMapPointDataLayerDefaultProperties(MapPointDataLayer mapPointDataLayer)
        {
            Assert.AreEqual("Test name", mapPointDataLayer.Name);
            Assert.IsTrue(mapPointDataLayer.IsVisible);
            Assert.IsFalse(mapPointDataLayer.ShowLabels);

            Assert.IsNotNull(mapPointDataLayer.LabelLayer);
            Assert.IsNull(mapPointDataLayer.LabelLayer.Symbology.Categories[0].Expression);

            var firstSymbol = (SimpleSymbol)mapPointDataLayer.Symbolizer.Symbols[0];

            Assert.AreEqual(4, firstSymbol.Size.Width);
            Assert.AreEqual(4, firstSymbol.Size.Height);
            Assert.AreEqual(PointShape.Ellipse, firstSymbol.PointShape);

            Assert.AreEqual(0, mapPointDataLayer.DataSet.Features.Count);
        }
예제 #4
0
        public void Constructor_MapPointDataWithTestProperties_MapPointDataLayerCreatedAccordingly()
        {
            // Setup
            Color color        = Color.AliceBlue;
            var   mapPointData = new MapPointData("Test name", new PointStyle
            {
                Color           = color,
                Size            = 4,
                Symbol          = PointSymbol.Circle,
                StrokeColor     = color,
                StrokeThickness = 1
            });

            SetMapPointDataTestProperties(mapPointData);

            // Call
            var mapPointDataLayer = new MapPointDataLayer(mapPointData);

            // Assert
            Assert.IsInstanceOf <MapPointLayer>(mapPointDataLayer);
            Assert.IsInstanceOf <IFeatureBasedMapDataLayer>(mapPointDataLayer);
            AssertMapPointDataLayerTestProperties(mapPointDataLayer);
            Assert.AreEqual(KnownCoordinateSystems.Projected.NationalGrids.Rijksdriehoekstelsel, mapPointDataLayer.Projection);
        }