예제 #1
0
        public void Save()
        {
            string          filename = "HydroNumerics.Time.Core.UnitTest.TimestampSeriesTest.Save.xts";
            TimestampSeries ts       = new TimestampSeries("TSName", new DateTime(2010, 1, 1), 10, 1, TimestepUnit.Days, 5.5);

            ts.Save(filename);
        }
예제 #2
0
        public void Load()
        {
            string          filename = "HydroNumerics.Time.Core.UnitTest.TimestampSeriesTest.Load.xts";
            TimestampSeries ts1      = new TimestampSeries("TSName", new DateTime(2010, 1, 1), 10, 1, TimestepUnit.Days, 5.5);

            ts1.Save(filename);

            TimestampSeries ts2 = new TimestampSeries();

            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].Time, ts2.Items[i].Time);
                Assert.AreEqual(ts1.Items[i].Value, ts2.Items[i].Value);
            }
        }