コード例 #1
0
 public void Using(CsvProfile profile)
 {
     if (profile != null)
     {
         this.profile = profile;
     }
 }
コード例 #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)"));
                }
            }
        }
コード例 #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));
                }
            }
        }
コード例 #4
0
 public ResultSetCsvWriter(string persistancePath, CsvProfile definition)
     : base(persistancePath)
 {
     Definition = definition;
 }
コード例 #5
0
 public EqualToConstraint CsvProfile(CsvProfile profile)
 {
     this.csvProfile = profile;
     return(this);
 }
コード例 #6
0
 public CsvReaderProxy(CsvProfile profile)
     : base(profile)
 {
 }
コード例 #7
0
 public BaseResultSetComparisonConstraint CsvProfile(CsvProfile profile)
 {
     this.csvProfile = profile;
     return(this);
 }
コード例 #8
0
ファイル: ResultSetBuilder.cs プロジェクト: jansaris/NBi
 public ResultSetBuilder(CsvProfile profile)
 {
     this.profile = profile;
 }
コード例 #9
0
 public CsvResultSetResolverArgs(string path, CsvProfile profile)
 {
     this.Path    = path;
     this.Profile = profile;
 }
コード例 #10
0
 public CsvResultSetResolverArgs(IScalarResolver <string> path, string basePath, CsvProfile profile)
 {
     this.Path     = path;
     this.BasePath = basePath;
     this.Profile  = profile;
 }
コード例 #11
0
 public ResultSetCsvWriter(string persistancePath, CsvProfile definition) : base(persistancePath)
 {
     Definition = definition;
 }
コード例 #12
0
 public ResultSetCsvWriter(string persistancePath) : base(persistancePath)
 {
     Definition = CsvProfile.SemiColumnDoubleQuote;
 }
コード例 #13
0
 public CsvReaderProxy(CsvProfile profile, int bufferSize)
     : base(profile, bufferSize)
 {
 }
コード例 #14
0
 public ResultSetBuilder(CsvProfile profile)
 {
     this.profile = profile;
 }