public void MapMultipleTypesTest() { var config = new CsvConfiguration(); config.ClassMapping <AMap>(); config.ClassMapping <BMap>(); Assert.IsNotNull(config.Maps[typeof(A)]); Assert.IsNotNull(config.Maps[typeof(B)]); }
public void AddingMappingsFromClassMapInstance() { var config = new CsvConfiguration(); config.ClassMapping(new TestClassMappings()); Assert.AreEqual(2, config.Properties.Count); }
public void AddingMappingsWithGenericMethod2() { var config = new CsvConfiguration(); config.ClassMapping <TestClassMappings>(); Assert.AreEqual(2, config.Properties.Count); }
public void AddingMappingsWithGenericMethod1() { var config = new CsvConfiguration(); config.ClassMapping <TestClassMappings>(); Assert.AreEqual(2, config.Maps[typeof(TestClass)].PropertyMaps.Count); }
private static void ReadRecordsTestBody() { const string source = "DecimalColumn;DateTimeColumn\r\n" + "12,0;11.11.2010\r\n"; var configuration = new CsvConfiguration { Delimiter = ";", }; configuration.ClassMapping <TestRecordWithDecimalMap>(); var reader = new CsvReader(new CsvParser(new StringReader(source), configuration)); var records = reader.GetRecords <TestRecordWithDecimal>().ToList(); Assert.AreEqual(1, records.Count()); var record = records.First(); Assert.AreEqual(12.0m, record.DecimalColumn); Assert.AreEqual(new DateTime(2010, 11, 11), record.DateTimeColumn); }
protected override void SetMapping(CsvConfiguration conf) { conf.ClassMapping <CriSupportiveCommunitiesCsvMap>(); }
protected override void SetMapping(CsvConfiguration conf) { conf.ClassMapping <CriEmergencyCsvMap>(); }
protected override void SetMapping(CsvConfiguration conf) { conf.ClassMapping <CriSoupKitchensCsvMap>(); }
protected override void SetMapping(CsvConfiguration conf) { conf.ClassMapping <CriClientEventsCountCsvMap>(); }