public async Task WriteCsvFile() { await using var fileStream = new FileStream(_tempFilePath, FileMode.Create); await using var fileWriter = new StreamWriter(fileStream); for (var i = 0; i < LineCount; i++) { await fileWriter.WriteAsync(Line); } var stateMachine = new TokenizerStateMachine(StateHolder.DefaultConfiguration); _tokenizer = new StateMachineTokenizer(stateMachine); var map = new ColumnMapBuilder <BenchmarkDataClass>() .WithColumn(0, c => c.Field1) .WithColumn(1, c => c.Field2) .WithColumn(2, c => c.Field3) .WithColumn(3, c => c.Field4) .WithColumn(4, c => c.Field5) .WithColumn(5, c => c.Field6) .WithColumn(6, c => c.Field7) .Build(); _mapper = new MapperFactory <BenchmarkDataClass>(ConverterRegistry.CreateDefaultInstance()).CreateForMap(map); }
public void SetUp() { var map = new ColumnMapBuilder <TestDataClass>() .WithColumn(0, t => t.FieldA) .WithColumn(1, t => t.FieldB) .Build(); _sut = CreateTokenStreamMapper(map); }
public void SetUp() { var stateMachine = new TokenizerStateMachine(StateHolder.DefaultConfiguration); _tokenizer = new StateMachineTokenizer(stateMachine); var map = new ColumnMapBuilder <StatePopulation>() .WithColumn(0, s => s.Name) .WithColumn(1, s => s.Population) .Build(); _sut = new MapperFactory <StatePopulation>(ConverterRegistry.CreateDefaultInstance()).CreateForMap(map); }