public void TestW3SVCLogs_HeaderLineInTheMiddle_WithDefaultMapping() { var lines = new List <string> { "2017-05-31 06:00:30 value1", }; var parser = new W3SVCLogParser(null, "#Fields: date time key1"); var log = string.Join(Environment.NewLine, lines); var context = new DelimitedLogContext() { FilePath = "Memory" }; using (var sr = new StreamReader(Utility.StringToStream(log))) { var records = parser.ParseRecords(sr, context).ToList(); Assert.Single(records); Assert.Equal("value1", records[0].Data["key1"]); context.Position = sr.BaseStream.Position; } lines.Add("#Fields: date time key2"); lines.Add("2017-05-31 06:00:30 value2"); log = string.Join(Environment.NewLine, lines); using (var sr = new StreamReader(Utility.StringToStream(log))) { var records = parser.ParseRecords(sr, context).ToList(); Assert.Single(records); Assert.Equal("value2", records[0].Data["key2"]); } }
public UlsLogRecord(string[] data, DelimitedLogContext context) : base(data, context) { }