Esempio n. 1
0
 public void Dialect_WithObjectInitializer_Ok()
 {
     using (var dialect = new TestDialect {
         DoubleQuote = true,
         Delimiter = ';',
         Quote = '\'',
         Escape = '\\',
         SkipInitialSpace = true,
         LineTerminator = "\r\n",
         Quoting = QuoteStyle.QuoteNone,
         Strict = true,
         HasHeader = false
     })
     {
         AreEqual(dialect.DoubleQuote, true);
         AreEqual(dialect.Delimiter, ';');
         AreEqual(dialect.Quote, '\'');
         AreEqual(dialect.Escape, '\\');
         AreEqual(dialect.SkipInitialSpace, true);
         AreEqual(dialect.LineTerminator, "\r\n");
         AreEqual(dialect.Quoting, QuoteStyle.QuoteNone);
         AreEqual(dialect.Strict, true);
         AreEqual(dialect.HasHeader, false);
     }
 }
Esempio n. 2
0
 public void Dialect_CustomDialectEqual_Ok()
 {
     using (var dialect = new TestDialect())
     {
         AreEqual(dialect.DoubleQuote, true);
         AreEqual(dialect.Delimiter, ';');
         AreEqual(dialect.Quote, '\'');
         AreEqual(dialect.Escape, '\\');
         AreEqual(dialect.SkipInitialSpace, true);
         AreEqual(dialect.LineTerminator, "\r\n");
         AreEqual(dialect.Quoting, QuoteStyle.QuoteNone);
         AreEqual(dialect.Strict, true);
         AreEqual(dialect.HasHeader, false);
     }
 }
Esempio n. 3
0
 public void Dialect_ShouldThrowDialectInternalErrorExceptionThenLineTerminatorNotSet_Ok()
 {
     Throws <DialectInternalErrorException>(() =>
     {
         using (var dialect = new TestDialect
         {
             DoubleQuote = true,
             Delimiter = ';',
             Quote = '\'',
             Escape = '\\',
             SkipInitialSpace = true,
             LineTerminator = null,
             Quoting = QuoteStyle.QuoteAll,
             Strict = true,
             HasHeader = false
         })
         {
             dialect.Check();
         }
     });
 }