Esempio n. 1
0
        public void SimpleTest()
        {
            var sdf = new SimpleDf("sdf");

            sdf.preferedType["id"]       = SdfColType.dfint;
            sdf.preferedType["dt"]       = SdfColType.dfdatetime;
            sdf.preferedFormat["dt"]     = "yyyy-MM-dd HH:mm:ss";
            sdf.preferedSubstitute["dt"] = ("+00", "");
            sdf.ReadCsv(sdflines);
            Assert.True(sdf.Nrow() == 3);
            Assert.True(sdf.Ncol() == 5);
            Assert.True(sdf.InfoClassStr() == "Classes:id:dfint,x:dfdouble,y:dfdouble,dt:dfdatetime,n:dfstring");
            Assert.True(sdf.GetIntCol("id").Sum() == 6);
            Assert.True(sdf.GetDoubleCol("x").Sum() == 6);
            Assert.True(sdf.GetDoubleCol("y").Sum() == 9);
            Assert.True(sdf.DataErrors() == 0);
            // Use the Assert class to test conditions
        }