Exemplo n.º 1
0
        public void mmDDyy()
        {
            string fn = Path.Combine(TestData.DataPath, "mmddyy.csv");

            Console.WriteLine("reading " + fn);
            TextSeries s = new TextSeries(fn);

            s.Read();
            Console.WriteLine("skipped the following\n" + s.Messages.ToString());
            s.WriteToConsole();
            Assert.AreEqual(5, s.Count);
        }
Exemplo n.º 2
0
        private void yyyymmdd(string filename)
        {
            DateTime[] dates =
            {
                new DateTime(1999, 1,  1, 12, 45, 19, 0),
                new DateTime(1999, 1, 20, 13,  0, 14, 0),
                new DateTime(1999, 1, 20, 13,  0, 14, 1),
            };
            double[] values = { 5.056, 5.061, 5.062 };

            TextSeries s = new TextSeries(filename);

            s.Read();
            s.WriteToConsole();
            Assert.IsTrue(s.Count == dates.Length, "should have 3 dates we have " + s.Count);
            for (int i = 0; i < dates.Length; i++)
            {
                Assert.IsTrue(s[i].DateTime == dates[i]);
                Assert.IsTrue(System.Math.Abs(s[i].Value - values[i]) < 0.000001);
            }
        }
Exemplo n.º 3
0
        private void mmddyyyy(string filename)
        {
            DateTime[] dates =
            {
                new DateTime(2005, 2, 1, 13, 2, 0, 0),
                new DateTime(2005, 2, 1, 13, 2, 4, 0),
                new DateTime(2005, 3, 1, 13, 3, 0, 0),
                new DateTime(2005, 4, 1,  2, 0, 1, 0)
            };
            double[] values = { 3, 5, 4.1, 5 };

            TextSeries s = new TextSeries(filename);

            s.Read();
            s.WriteToConsole();
            Assert.IsTrue(s.Count == dates.Length, "should have 4 dates we have " + s.Count);
            for (int i = 0; i < dates.Length; i++)
            {
                Assert.IsTrue(s[i].DateTime == dates[i]);
                Assert.IsTrue(System.Math.Abs(s[i].Value - values[i]) < 0.000001);
            }
        }