Exemplo n.º 1
0
 public void Using(CsvProfile profile)
 {
     if (profile != null)
     {
         this.profile = profile;
     }
 }
Exemplo n.º 2
0
        public void Read_MissingValue_MatchWithNullValue()
        {
            using (var stream = new MemoryStream())
            {
                using (var writer = new StreamWriter(stream))
                {
                    writer.Write("a;b;c\r\na;b\r\na;b;c");
                    writer.Flush();

                    stream.Position = 0;

                    var profile   = new CsvProfile(';', '"', "\r\n", false, true, 512, string.Empty, "(null)");
                    var reader    = new CsvReaderProxy(profile);
                    var dataTable = reader.Read(stream);
                    Assert.That(dataTable.Rows[1][2], Is.EqualTo("(null)"));
                }
            }
        }
Exemplo n.º 3
0
        public void Read_Comment_CommentedLinesSkipped(string content)
        {
            using (var stream = new MemoryStream())
            {
                using (var writer = new StreamWriter(stream))
                {
                    writer.Write(content);
                    writer.Flush();

                    stream.Position = 0;

                    var profile = new CsvProfile(new CsvDialectDescriptor {
                        Header = false, Delimiter = ';', CommentChar = '#', DoubleQuote = false
                    });
                    var reader    = new CsvReaderProxy(profile);
                    var dataTable = reader.Read(stream);
                    Assert.That(dataTable.Rows.Count, Is.EqualTo(2));
                    Assert.That(dataTable.Columns.Count, Is.EqualTo(3));
                }
            }
        }
Exemplo n.º 4
0
 public ResultSetCsvWriter(string persistancePath, CsvProfile definition)
     : base(persistancePath)
 {
     Definition = definition;
 }
Exemplo n.º 5
0
 public EqualToConstraint CsvProfile(CsvProfile profile)
 {
     this.csvProfile = profile;
     return(this);
 }
Exemplo n.º 6
0
 public CsvReaderProxy(CsvProfile profile)
     : base(profile)
 {
 }
 public BaseResultSetComparisonConstraint CsvProfile(CsvProfile profile)
 {
     this.csvProfile = profile;
     return(this);
 }
Exemplo n.º 8
0
 public ResultSetBuilder(CsvProfile profile)
 {
     this.profile = profile;
 }
Exemplo n.º 9
0
 public CsvResultSetResolverArgs(string path, CsvProfile profile)
 {
     this.Path    = path;
     this.Profile = profile;
 }
Exemplo n.º 10
0
 public CsvResultSetResolverArgs(IScalarResolver <string> path, string basePath, CsvProfile profile)
 {
     this.Path     = path;
     this.BasePath = basePath;
     this.Profile  = profile;
 }
Exemplo n.º 11
0
 public ResultSetCsvWriter(string persistancePath, CsvProfile definition) : base(persistancePath)
 {
     Definition = definition;
 }
Exemplo n.º 12
0
 public ResultSetCsvWriter(string persistancePath) : base(persistancePath)
 {
     Definition = CsvProfile.SemiColumnDoubleQuote;
 }
Exemplo n.º 13
0
 public CsvReaderProxy(CsvProfile profile, int bufferSize)
     : base(profile, bufferSize)
 {
 }
Exemplo n.º 14
0
 public ResultSetBuilder(CsvProfile profile)
 {
     this.profile = profile;
 }