public void write_char_to_buffer_can_be_used_to_customize_the_way_values_are_written() { var stringWriter = new StringWriter(); var writer = new CustomCsvWriter(stringWriter); writer.ValueDelimiter = '\''; writer.NewLine = string.Empty; writer.WriteRecord("foo", "bar", "foo-bar"); writer.Flush(); Assert.Equal("foo,bar,'foo-bar'", stringWriter.ToString()); }
private void Export() { if (_coralPatches != null && _coralPatches.Count > 1) { try { var writer = new CustomCsvWriter(); writer.WriteCsv(_coralPatches.Where(p => !p.IsRelativePosition)); } catch (Exception x) { MessageBox.Show("There was an error while saving. Try saving to another file for now."); } } }
public void write_char_to_buffer_can_be_used_to_customize_the_way_values_are_written() { var stringWriter = new StringWriter(); var writer = new CustomCsvWriter(stringWriter); writer.ValueDelimiter = '\''; writer.NewLine = string.Empty; writer.WriteRecord("foo", "bar", "foo-bar"); writer.Flush(); Assert.Equal("foo,bar,'foo-bar'", stringWriter.ToString()); }