Skip to content

ChoCSVWriter - No Header Output When Using WriteFields #320

Open
@jamesflagg

Description

@jamesflagg

When using WriteFields as a shorthand for writing records without a record object, it seems that no header is written, even though one has been designated. Is this the expected behavior, or should it be consistent with writing records using record objects?
Note that the non-header records are written as expected.

public class ChoWriterTest {       [Fact]       public void WriteHeaderAndFields()       {             using var writer = new StringWriter();             using var choWriter = new ChoCSVWriter(writer).WithFirstLineHeader();             choWriter.WriteHeader("A", "B");             choWriter.WriteFields("A1", "B1");             choWriter.WriteFields("A2", "B2");             choWriter.Flush();             writer.Flush();             var result = writer.ToString();             Assert.StartsWith("A,B", result);       } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions