예제 #1
0
        public void Constructor_WithAllParameters_SetsProperties()
        {
            // Setup
            Color     color               = Color.AliceBlue;
            const int size                = 3;
            Color     strokeColor         = Color.AntiqueWhite;
            const int strokeThickness     = 2;
            const ChartPointSymbol symbol = ChartPointSymbol.Circle;

            // Call
            var pointStyle = new ChartPointStyle
            {
                Color           = color,
                StrokeColor     = strokeColor,
                Size            = size,
                StrokeThickness = strokeThickness,
                Symbol          = symbol,
                IsEditable      = true
            };

            // Assert
            Assert.AreEqual(color, pointStyle.Color);
            Assert.AreEqual(size, pointStyle.Size);
            Assert.AreEqual(strokeColor, pointStyle.StrokeColor);
            Assert.AreEqual(strokeThickness, pointStyle.StrokeThickness);
            Assert.AreEqual(symbol, pointStyle.Symbol);
            Assert.IsTrue(pointStyle.IsEditable);
        }
예제 #2
0
 private static void AssertEqualStyle(ChartPointStyle pointStyle, Color fillColor, int size, Color strokeColor, int strokeThickness, ChartPointSymbol symbol)
 {
     Assert.AreEqual(fillColor, pointStyle.Color);
     Assert.AreEqual(size, pointStyle.Size);
     Assert.AreEqual(strokeColor, pointStyle.StrokeColor);
     Assert.AreEqual(strokeThickness, pointStyle.StrokeThickness);
     Assert.AreEqual(symbol, pointStyle.Symbol);
     Assert.IsTrue(pointStyle.IsEditable);
 }
예제 #3
0
        /// <summary>
        /// Creates a new instance of <see cref="ChartPointData"/>.
        /// </summary>
        /// <param name="name">The name of the <see cref="ChartPointData"/>.</param>
        /// <param name="style">The style of the data.</param>
        /// <exception cref="ArgumentException">Thrown when <paramref name="name"/> is
        /// <c>null</c> or only whitespace.</exception>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="style"/>
        /// is <c>null</c>.</exception>
        public ChartPointData(string name, ChartPointStyle style) : base(name)
        {
            if (style == null)
            {
                throw new ArgumentNullException(nameof(style));
            }

            Style = style;
        }
예제 #4
0
        public void Size_SetValidValue_ValueSet(int validValue)
        {
            // Setup
            var pointStyle = new ChartPointStyle();

            // Call
            pointStyle.Size = validValue;

            // Assert
            Assert.AreEqual(validValue, pointStyle.Size);
        }
예제 #5
0
        public void StrokeThickness_SetValidValue_ValueSet(int validValue)
        {
            // Setup
            var pointStyle = new ChartPointStyle();

            // Call
            pointStyle.StrokeThickness = validValue;

            // Assert
            Assert.AreEqual(validValue, pointStyle.StrokeThickness);
        }
예제 #6
0
        protected override void SetSeriesStyle(ChartPointData data, LineSeries series)
        {
            series.LineStyle = LineStyle.None;
            ChartPointStyle style = data.Style;

            series.MarkerFill            = ChartDataHelper.Convert(style.Color);
            series.MarkerSize            = style.Size;
            series.MarkerType            = ChartDataHelper.Convert(style.Symbol);
            series.MarkerStroke          = ChartDataHelper.Convert(style.StrokeColor);
            series.MarkerStrokeThickness = style.StrokeThickness;
        }
예제 #7
0
        public void Size_SetInvalidValue_ThrowsArgumentOutOfRangeException(int invalidValue)
        {
            // Setup
            var pointStyle = new ChartPointStyle();

            // Call
            TestDelegate test = () => pointStyle.Size = invalidValue;

            // Assert
            const string message = "De waarde voor grootte moet in het bereik [0, 48] liggen.";

            TestHelper.AssertThrowsArgumentExceptionAndTestMessage <ArgumentOutOfRangeException>(test, message);
        }
예제 #8
0
        public void Constructor_WithStyle_ExpectedValue()
        {
            // Setup
            var style = new ChartPointStyle();

            // Call
            var data = new ChartPointData("test data", style);

            // Assert
            Assert.AreEqual("test data", data.Name);
            CollectionAssert.IsEmpty(data.Points);
            Assert.IsInstanceOf <PointBasedChartData>(data);
            Assert.AreSame(style, data.Style);
        }