Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1981


Ignore:
Timestamp:
05/31/09 20:38:11 (15 years ago)
Author:
mstoeger
Message:

added a few tests. #498

Location:
trunk/sources/HeuristicLab.Visualization.Test/3.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization.Test/3.2/LineChartTestForm.cs

    r1530 r1981  
    88  public partial class LineChartTestForm : Form {
    99    private readonly IView view;
    10     private ChartDataRowsModel model;
     10    private readonly ChartDataRowsModel model;
    1111
    1212    public LineChartTestForm() {
  • trunk/sources/HeuristicLab.Visualization.Test/3.2/LineChartTests.cs

    r1972 r1981  
    1515
    1616    [Test]
    17     public void TestLineChart() {
     17    public void TestLineChartWithManyDataPoints() {
    1818      LineChartTestForm f = new LineChartTestForm(model);
    1919
     
    7272
    7373    [Test]
     74    public void TestGrid() {
     75      LineChartTestForm f = new LineChartTestForm(model);
     76
     77      model.XAxis.ShowGrid = true;
     78      model.XAxis.GridColor = Color.Red;
     79
     80      model.DefaultYAxis.ShowGrid = true;
     81      model.DefaultYAxis.GridColor = Color.Blue;
     82
     83      IDataRow row1 = new DataRow();
     84      row1.RowSettings.Label = "row1";
     85
     86      model.AddDataRow(row1);
     87
     88      row1.AddValue(0);
     89      row1.AddValue(10);
     90
     91      f.ShowDialog();
     92    }
     93
     94    [Test]
     95    public void TestShowMarkers() {
     96      LineChartTestForm f = new LineChartTestForm(model);
     97
     98      IDataRow row1 = new DataRow();
     99      row1.RowSettings.Label = "row1";
     100      row1.RowSettings.Color = Color.Red;
     101      row1.RowSettings.ShowMarkers = true;
     102
     103      IDataRow row2 = new DataRow();
     104      row2.RowSettings.Label = "row2";
     105      row2.RowSettings.Color = Color.Blue;
     106      row2.RowSettings.ShowMarkers = false;
     107
     108      model.AddDataRow(row1);
     109      model.AddDataRow(row2);
     110
     111      for (int i = 0; i < 10; i++) {
     112        row1.AddValue(i);
     113        row2.AddValue(i*2);
     114      }
     115
     116      f.ShowDialog();
     117    }
     118
     119    [Test]
     120    public void TestShowLabelOnAxes() {
     121      LineChartTestForm f = new LineChartTestForm(model);
     122
     123      IDataRow row1 = new DataRow();
     124      IDataRow row2 = new DataRow();
     125
     126      model.XAxis.Label = "X-Axis";
     127      model.XAxis.ShowLabel = true;
     128
     129      row1.YAxis = model.DefaultYAxis;
     130      row1.YAxis.Label = "Y-Axis row1";
     131      row1.RowSettings.Color = Color.Blue;
     132      row1.YAxis.ShowYAxisLabel = false;
     133
     134      row2.YAxis = new YAxisDescriptor();
     135      row2.YAxis.Label = "Y-Axis row2";
     136      row2.RowSettings.Color = Color.Red;
     137      row2.YAxis.ShowYAxisLabel = true;
     138
     139      model.AddDataRow(row1);
     140      model.AddDataRow(row2);
     141
     142      row1.AddValue(0);
     143      row1.AddValue(10);
     144      row1.AddValue(15);
     145      row1.AddValue(16);
     146
     147      row2.AddValue(0);
     148      row2.AddValue(20);
     149      row2.AddValue(25);
     150      row2.AddValue(26);
     151
     152      f.ShowDialog();
     153    }
     154
     155    [Test]
    74156    public void TestAxes() {
    75157      LineChartTestForm f = new LineChartTestForm(model);
     
    88170
    89171      yaxis1.Label = "Y-Axis 1";
    90       yaxis1.ShowYAxisLabel = true;
    91172      yaxis1.Position = AxisPosition.Left;
    92       yaxis1.ShowGrid = true;
    93       yaxis1.GridColor = Color.Gray;
    94173
    95174      yaxis2.Label = "Y-Axis 2";
    96       yaxis2.ShowYAxisLabel = true;
    97175      yaxis2.Position = AxisPosition.Right;
    98       yaxis2.ShowGrid = false;
    99176
    100177      row1.RowSettings.Color = Color.Red;
    101       row1.RowSettings.Thickness = 3;
    102       row1.RowSettings.Style = DrawingStyle.Solid;
    103178      row1.RowSettings.Label = "Die Rote";
    104179
    105180      row2.RowSettings.Color = Color.Green;
    106       row2.RowSettings.Thickness = 3;
    107       row2.RowSettings.Style = DrawingStyle.Solid;
    108181      row2.RowSettings.Label = "Die Grüne";
    109182
    110183      row3.RowSettings.Color = Color.Blue;
    111       row3.RowSettings.Thickness = 3;
    112       row3.RowSettings.Style = DrawingStyle.Solid;
    113184      row3.RowSettings.Label = "Die Blaue";
    114185      row3.YAxis = yaxis2;
     
    131202        row3.AddValue(rand.NextDouble() * 1);
    132203      };
     204
     205      f.ShowDialog();
     206    }
     207
     208    [Test]
     209    public void TestDataRowWithOnlyOneValueShouldntCauseZoomLevelTooHighError() {
     210      LineChartTestForm f = new LineChartTestForm(model);
     211
     212      IDataRow row1 = new DataRow();
     213      row1.AddValue(10);
     214
     215      model.AddDataRow(row1);
    133216
    134217      f.ShowDialog();
Note: See TracChangeset for help on using the changeset viewer.