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); }
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); }
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); }
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); }