コード例 #1
0
        public void Create_NullData_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate test = () => ChartDataSeriesFactory.Create(null);

            // Assert
            Assert.Throws <ArgumentNullException>(test);
        }
コード例 #2
0
        public void Create_ChartMultipleLineData_ReturnChartMultipleLineDataSeries()
        {
            // Call
            IChartDataSeries series = ChartDataSeriesFactory.Create(new ChartMultipleLineData("test data"));

            // Assert
            Assert.IsInstanceOf <ChartMultipleLineDataSeries>(series);
        }
コード例 #3
0
        public void Create_OtherData_ThrowsNotSupportedException()
        {
            // Setup
            var testData = new TestChartData("test data");

            // Call
            TestDelegate test = () => ChartDataSeriesFactory.Create(testData);

            // Assert
            Assert.Throws <NotSupportedException>(test);
        }
コード例 #4
0
        private void DrawChartData(ChartData chartData)
        {
            IChartDataSeries chartDataSeries = ChartDataSeriesFactory.Create(chartData);

            var drawnChartData = new DrawnChartData
            {
                ChartData       = chartData,
                ChartDataSeries = chartDataSeries
            };

            drawnChartData.Observer = new Observer(() =>
            {
                drawnChartData.ChartDataSeries.Update();
                plotView.InvalidatePlot(true);
            })
            {
                Observable = chartData
            };

            drawnChartDataList.Add(drawnChartData);

            plotView.Model.Series.Add((Series)chartDataSeries);
        }