public void SplitLine_NullField_NullValue() { var reader = new CsvReaderProxy(); var values = reader.SplitLine("a;(null)", ';', char.MinValue, char.MinValue, string.Empty); Assert.That(values.ElementAt(1), Is.Null); }
public void SplitLine_RecordWithThreeFields_CorrectParsing(string record, string thirdToken) { var reader = new CsvReaderProxy(); var values = reader.SplitLine(record, ';', '\'', '\'', string.Empty).ToList(); Assert.That(values[2], Is.EqualTo(thirdToken)); }
public void SplitLine_RecordWithTwoFields_CorrectParsing(string record, string firstToken) { var reader = new CsvReaderProxy(); var values = reader.SplitLine(record, ';', '\'', '\'', string.Empty).ToList(); Assert.That(values[0], Is.EqualTo(firstToken)); Assert.That(values[1], Is.EqualTo("xyz")); }
public void SplitLine_RecordWithUnescapedTextQualifier_ThrowException(string record) { var reader = new CsvReaderProxy(); Assert.Throws <ArgumentException>(() => reader.SplitLine(record, ';', '\'', '\'', string.Empty).ToList()); }