Пример #1
0
 public void ReadBadRowsIgnoreErrorEnabled()
 {
     CsvTestReader reader = new CsvTestReader(@"..\..\InvalidCsv.txt", true);
     reader.Read();
     Assert.AreEqual(3, reader.getErrors().Count);
     reader.Close();
 }
Пример #2
0
 public void OpenAndClose()
 {
     CsvTestReader reader = new CsvTestReader(@"..\..\SimpleCsv.txt");
     Assert.AreEqual(reader.IsClosed, false);
     reader.Close();
     Assert.AreEqual(reader.IsClosed, true);
 }
Пример #3
0
 public void ReadBadRows()
 {
     CsvTestReader reader = new CsvTestReader(@"..\..\InvalidCsv.txt");
     while (reader.Read())
     {
     }
     reader.Close();
 }
Пример #4
0
        public void ReadBadRowValues()
        {
            CsvTestReader reader = new CsvTestReader(@"..\..\InvalidCsv.txt");
            reader.Read();
            Assert.AreEqual("Test", reader.GetValue(0));

            reader.Read();
            Assert.AreEqual("One,Two,Three,Four", reader.GetValue(0));

            reader.Read();
            Assert.AreEqual(@"""Row", reader.GetValue(0));

            Assert.AreEqual(false, reader.Read());

            reader.Close();
        }
Пример #5
0
 public void TestOfGoodFile()
 {
     CsvTestReader reader = new CsvTestReader(@"..\..\SimpleCsv.txt");
     Assert.AreEqual(false, reader.Read());
 }
Пример #6
0
 public void SimpleOpen()
 {
     CsvTestReader reader = new CsvTestReader(@"..\..\SimpleCsv.txt");
 }