Exemple #1
0
        public async Task GetIntegerTest()
        {
            using (var process = new CustomProcessDisplay(UnitTestInitializeCsv.Token))
                using (var reader = new CsvFileReader(UnitTestHelper.ReaderGetAllFormats(), process))
                {
                    await reader.OpenAsync(process.CancellationToken);

                    var wrapper = new DataReaderWrapper(reader);
                    await wrapper.ReadAsync(process.CancellationToken);

                    Assert.AreEqual((short)-22477, wrapper.GetInt16(1));
                    Assert.AreEqual(-22477, wrapper.GetInt32(1));
                    Assert.AreEqual(-22477L, wrapper.GetInt64(1));
                }
        }
Exemple #2
0
 public override Int32 GetValue(DataReaderWrapper dataReader, int columnIndex, Type targetType)
 {
     return(dataReader.GetInt16(columnIndex));
 }
 protected override Int16?GetValueWhenNotNull(DataReaderWrapper dataReader, int columnIndex)
 {
     return(dataReader.GetInt16(columnIndex));
 }
 public override UInt64 GetValue(DataReaderWrapper dataReader, int columnIndex, Type targetType)
 {
     return(Convert.ToUInt64(dataReader.GetInt16(columnIndex)));
 }