public void GivenChartMultipleLineDataSeries_WhenUpdatedAfterChartMultipleLineDataLinesChanged_ChartMultipleLineDataSeriesLinesChanged() { // Given var chartMultipleLineData = new ChartMultipleLineData("Test name") { Lines = new[] { new[] { new Point2D(1.1, 2.2) } } }; var chartMultipleLineDataSeries = new ChartMultipleLineDataSeries(chartMultipleLineData); IEnumerable <DataPoint>[] drawnLines = chartMultipleLineDataSeries.Lines.ToArray(); // When chartMultipleLineData.Lines = new[] { new[] { new Point2D(3.3, 4.4) } }; chartMultipleLineDataSeries.Update(); // Then CollectionAssert.AreNotEqual(drawnLines, chartMultipleLineDataSeries.Lines); }
private static void AssertChartMultipleLineDataSeriesDefaultProperties(ChartMultipleLineDataSeries chartMultipleLineDataSeries) { Assert.AreEqual("Test name", chartMultipleLineDataSeries.Title); Assert.IsTrue(chartMultipleLineDataSeries.IsVisible); Assert.AreEqual(3, chartMultipleLineDataSeries.StrokeThickness); Assert.AreEqual(OxyColor.FromArgb(color.A, color.R, color.G, color.B), chartMultipleLineDataSeries.Color); Assert.AreEqual(LineStyle.Dash, chartMultipleLineDataSeries.LineStyle); Assert.AreEqual(0, chartMultipleLineDataSeries.Lines.Count); }
public void Constructor_ChartMultipleLineDataWithTestProperties_ChartMultipleLineDataSeriesCreatedAccordingly() { // Setup var chartMultipleLineData = new ChartMultipleLineData("Test name", new ChartLineStyle { Color = color, Width = 3, DashStyle = ChartLineDashStyle.Dash }); SetChartMultipleLineDataTestProperties(chartMultipleLineData); // Call var chartMultipleLineDataSeries = new ChartMultipleLineDataSeries(chartMultipleLineData); // Assert Assert.IsInstanceOf <MultipleLineSeries>(chartMultipleLineDataSeries); Assert.IsInstanceOf <IChartDataSeries>(chartMultipleLineDataSeries); AssertChartMultipleLineDataSeriesTestProperties(chartMultipleLineDataSeries); }
public void Update_ChartMultipleLineDataWithTestProperties_ChartMultipleLineDataSeriesUpdatedAccordingly() { // Setup var chartMultipleLineData = new ChartMultipleLineData("Test name", new ChartLineStyle { Color = color, Width = 3, DashStyle = ChartLineDashStyle.Dash }); var chartMultipleLineDataSeries = new ChartMultipleLineDataSeries(chartMultipleLineData); SetChartMultipleLineDataTestProperties(chartMultipleLineData); // Precondition AssertChartMultipleLineDataSeriesDefaultProperties(chartMultipleLineDataSeries); // Call chartMultipleLineDataSeries.Update(); // Assert AssertChartMultipleLineDataSeriesTestProperties(chartMultipleLineDataSeries); }