Changeset 16483


Ignore:
Timestamp:
01/02/19 20:18:56 (6 months ago)
Author:
gkronber
Message:

#2520: added unit test for IndexedDataTable and Point2D and made necessary fixes

Location:
branches/2520_PersistenceReintegration
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2520_PersistenceReintegration/HeuristicLab.Analysis/3.3/DataVisualization/DataRowVisualProperties.cs

    r16462 r16483  
    3333  public class DataRowVisualProperties : DeepCloneable, INotifyPropertyChanged {
    3434    #region ChartType
     35    [StorableType("488A018F-AF79-4B60-989A-845EF24F4A01")]
    3536    public enum DataRowChartType {
    3637      Line,
     
    4142      StepLine
    4243    }
     44
    4345    #endregion
    4446    #region LineStyle
     47    [StorableType("A064C2CE-D2CC-4292-B5FC-8DDCFA55C896")]
    4548    public enum DataRowLineStyle {
    4649      Dash,
  • branches/2520_PersistenceReintegration/HeuristicLab.Analysis/3.3/DataVisualization/DataTableVisualProperties.cs

    r16462 r16483  
    3333
    3434    #region Histogram Aggregation
     35    [StorableType("323A07AD-207C-4D45-B7EC-4E3E48F1E5C6")]
    3536    public enum DataTableHistogramAggregation {
    3637      Overlapping,
  • branches/2520_PersistenceReintegration/HeuristicLab.Common/3.3/Point2D.cs

    r16471 r16483  
    3131    public static readonly Point2D<T> Empty = new Point2D<T>();
    3232
    33     [Storable]
    3433    private T x;
    3534    public T X {
     
    3736    }
    3837
    39     [Storable]
    4038    private T y;
    4139    public T Y {
     
    4341    }
    4442
    45     [Storable]
    4643    private object tag;
    4744    public object Tag {
  • branches/2520_PersistenceReintegration/HeuristicLab.Tests/HeuristicLab.Persistence.Fossil/UseCases.cs

    r16482 r16483  
    166166      }
    167167    }
    168    
    169     // TODO:
    170     // - IndexedItem and IndexedDataTable
    171     // - Point2D from HL.Common
     168
     169    [TestMethod]
     170    [TestCategory("Persistence.Fossil")]
     171    [TestProperty("Time", "short")]
     172    public void TestIndexedDataTable() {
     173      var dt = new IndexedDataTable<int>("test", "test description");
     174      var dr = new IndexedDataRow<int>("test row");
     175      dr.Values.Add(Tuple.Create(1, 1.0));
     176      dr.Values.Add(Tuple.Create(2, 2.0));
     177      dr.Values.Add(Tuple.Create(3, 3.0));
     178      dt.Rows.Add(dr);
     179      var ser = new ProtoBufSerializer();
     180      ser.Serialize(dt, tempFile);
     181      var dt2 = (IndexedDataTable<int>)ser.Deserialize(tempFile);
     182      Assert.AreEqual(dt.Rows["test row"].Values[0], dt2.Rows["test row"].Values[0]);
     183      Assert.AreEqual(dt.Rows["test row"].Values[1], dt2.Rows["test row"].Values[1]);
     184      Assert.AreEqual(dt.Rows["test row"].Values[2], dt2.Rows["test row"].Values[2]);
     185    }
     186
     187    [TestMethod]
     188    [TestCategory("Persistence.Fossil")]
     189    [TestProperty("Time", "short")]
     190    public void TestPoint2d() {
     191      var tag = new IntValue(10);
     192      var p = new Point2D<double>(1.0, 2.0, tag);
     193      var ser = new ProtoBufSerializer();
     194      ser.Serialize(p, tempFile);
     195      var p2 = (Point2D<double>)ser.Deserialize(tempFile);
     196      Assert.AreEqual(p.X, p2.X);
     197      Assert.AreEqual(p.Y, p2.Y);
     198      var tag2 = (IntValue)p2.Tag;
     199      Assert.AreEqual(tag.Value, tag2.Value);
     200    }
    172201
    173202    [ClassInitialize]
Note: See TracChangeset for help on using the changeset viewer.