コード例 #1
0
        public async Task CsvWriterAsync_WriteValues()
        {
            using var sw = new StringWriter();
            var writer = new CsvWriter(sw);

            writer.EndOfLine = "\n";
            await writer.BeginRowAsync().ConfigureAwait(false);

            await writer.WriteValuesAsync("A", "B").ConfigureAwait(false);

            await writer.WriteValuesAsync("C", "D").ConfigureAwait(false);

            await writer.BeginRowAsync().ConfigureAwait(false);

            await writer.WriteValuesAsync("E").ConfigureAwait(false);

            Assert.Equal("A,B,C,D\nE", sw.ToString());
        }