public async Task TestReadWriteAsync_Comments() { StringWriter output = new StringWriter(); SeparatedValueWriter writer = new SeparatedValueWriter(output); await writer.WriteAsync(new[] { "a", "b", "c" }); await writer.WriteRawAsync("# Hello, world!!!", true); await writer.WriteAsync(new[] { "d", "e", "f" }); StringReader input = new StringReader(output.ToString()); SeparatedValueReader reader = new SeparatedValueReader(input); reader.RecordRead += (sender, e) => { e.IsSkipped = e.Values.Length > 0 && e.Values[0].StartsWith("#"); }; Assert.IsTrue(await reader.ReadAsync()); CollectionAssert.AreEqual(new[] { "a", "b", "c" }, reader.GetValues()); Assert.IsTrue(await reader.ReadAsync()); CollectionAssert.AreEqual(new[] { "d", "e", "f" }, reader.GetValues()); Assert.IsFalse(await reader.ReadAsync()); }