Esempio n. 1
0
        static void Main(string[] args)
        {
            //IImporter importer = new SimpleCsvImporter(@"C:\Users\Tal\Desktop\CSV_Project\DataDisplay\SampleData\us-500.csv");
            //importer.Load();

            string      filename       = @"new2.txt";
            string      AppDir         = AppDomain.CurrentDomain.BaseDirectory;
            string      relativePath   = AppDir + filename;
            CsvImporter newCsvImporter = new CsvImporter(relativePath, GenerateFakeColumnTypes());
            bool        endOfFile;
            IEnumerable <DataObject> dataObjects  = newCsvImporter.LoadRange(3, out endOfFile);
            IEnumerable <DataObject> dataObjects2 = newCsvImporter.LoadRange(3, out endOfFile);
        }
Esempio n. 2
0
        public void LoadNext_LoadLast3Lines_Success()
        {
            CsvImporter importer = new CsvImporter(relativePath, TestInitializationFactory.GenerateFakeColumnTypes());
            bool        endOfFile;
            var         result   = importer.LoadRange(3, out endOfFile, 4);
            int         numItems = EnumerateTestAndCount(result);

            // Test that All items have been read
            Assert.AreEqual(numItems, 3);
            Assert.AreEqual(endOfFile, true);
        }