示例#1
0
        public void SubstractTest()
        {
            FixedTimeStepSeries ts1 = new FixedTimeStepSeries();
            FixedTimeStepSeries ts2 = new FixedTimeStepSeries();

            ts1.StartTime = new DateTime(2010, 1, 1);
            ts1.AddRange(new double[] { 2, 3, 4 });
            ts1.TimeStepSize = TimeStepUnit.Month;

            ts2.StartTime = new DateTime(2010, 1, 1);
            ts2.AddRange(new double[] { 1, 1, 1 });
            ts2.TimeStepSize = TimeStepUnit.Month;


            FixedTimeStepSeries actual;

            actual = TSTools.Substract(ts1, ts2);
            Assert.AreEqual(1, actual.GetValue(new DateTime(2010, 1, 1)));
            Assert.AreEqual(2, actual.GetValue(new DateTime(2010, 2, 1)));
        }