Exemplo n.º 1
0
        private static ILineSymbolizer CreateExpectedSymbolizer(LineStyle expectedLineStyle)
        {
            DashStyle expectedDashStyle = MapDataHelper.Convert(expectedLineStyle.DashStyle);
            Color     expectedColor     = expectedLineStyle.Color;

            return(new LineSymbolizer(expectedColor, expectedColor, expectedLineStyle.Width, expectedDashStyle, LineCap.Round));
        }
Exemplo n.º 2
0
        public void Convert_ValidLineDashStyle_ReturnsExpectedDashStyle(LineDashStyle lineDashStyle,
                                                                        DashStyle expectedDashStyle)
        {
            // Call
            DashStyle dashStyle = MapDataHelper.Convert(lineDashStyle);

            // Assert
            Assert.AreEqual(expectedDashStyle, dashStyle);
        }
Exemplo n.º 3
0
        public void Convert_ValidPointSymbol_ReturnExpectedShape(PointSymbol pointSymbol,
                                                                 PointShape expectedShape)
        {
            // Call
            PointShape symbol = MapDataHelper.Convert(pointSymbol);

            // Assert
            Assert.AreEqual(expectedShape, symbol);
        }
Exemplo n.º 4
0
        private static PointSymbolizer CreateExpectedSymbolizer(PointStyle expectedPointStyle)
        {
            PointShape expectedPointShape = MapDataHelper.Convert(expectedPointStyle.Symbol);

            var expectedSymbolizer = new PointSymbolizer(expectedPointStyle.Color, expectedPointShape, expectedPointStyle.Size);

            expectedSymbolizer.SetOutline(expectedPointStyle.StrokeColor, expectedPointStyle.StrokeThickness);

            return(expectedSymbolizer);
        }
Exemplo n.º 5
0
        public void Convert_InvalidLineDashStyle_ThrowsInvalidEnumArgumentException()
        {
            // Setup
            const int invalidValue = 100;

            // Call
            TestDelegate call = () => MapDataHelper.Convert((LineDashStyle)invalidValue);

            // Assert
            string expectedMessage = $"The value of argument 'dashStyle' ({invalidValue}) is invalid for Enum type '{nameof(LineDashStyle)}'.";
            string parameterName   = TestHelper.AssertThrowsArgumentExceptionAndTestMessage <InvalidEnumArgumentException>(call, expectedMessage).ParamName;

            Assert.AreEqual("dashStyle", parameterName);
        }
Exemplo n.º 6
0
        public void ConvertLayerProperties_MapLineDataWithStyle_ConvertsStyleToMapLineLayer(
            [Values(KnownColor.AliceBlue, KnownColor.Azure)]
            KnownColor color,
            [Values(1, 5)] int width,
            [Values(LineDashStyle.Solid, LineDashStyle.Dash)]
            LineDashStyle lineStyle)
        {
            // Setup
            Color expectedColor = Color.FromKnownColor(color);
            var   converter     = new MapLineDataConverter();
            var   mapLineLayer  = new MapLineLayer();
            var   mapLineData   = new MapLineData("test", new LineStyle
            {
                Color     = expectedColor,
                Width     = width,
                DashStyle = lineStyle
            });

            // Call
            converter.ConvertLayerProperties(mapLineData, mapLineLayer);

            // Assert
            AssertAreEqual(new LineSymbolizer(expectedColor, expectedColor, width, MapDataHelper.Convert(lineStyle), LineCap.Round), mapLineLayer.Symbolizer);
        }