public void Load() { string filename = "HydroNumerics.Time.Core.UnitTest.TimespanSeriesTest.Load.xts"; TimespanSeries ts1 = new TimespanSeries("TSName", new DateTime(2010, 1, 1), 10, 1, TimestepUnit.Days, 5.5); ts1.Save(filename); TimespanSeries ts2 = new TimespanSeries(); ts2.Load(filename); Assert.AreEqual(ts1.Id, ts2.Id); Assert.AreEqual(ts1.Description, ts2.Description); Assert.AreEqual(ts1.Name, ts2.Name); Assert.AreEqual(ts1.Unit, ts2.Unit); Assert.AreEqual(ts1.Items.Count, ts2.Items.Count); for (int i = 0; i < ts1.Items.Count; i++) { Assert.AreEqual(ts1.Items[i].StartTime, ts2.Items[i].StartTime); Assert.AreEqual(ts1.Items[i].EndTime, ts2.Items[i].EndTime); Assert.AreEqual(ts1.Items[i].Value, ts2.Items[i].Value); } }
public void Save() { string filename = "HydroNumerics.Time.Core.UnitTest.TimespanSeriesTest.Save.xts"; TimespanSeries ts = new TimespanSeries("TSName", new DateTime(2010, 1, 1), 10, 1, TimestepUnit.Days, 5.5); ts.Save(filename); }