public void SxFyEntry_Default_PropertyValuesAsExpected() { var sut = new SxFyLogEntry(new List <string> { this.sampleSxFy }); sut.Should().BeAssignableTo <LogEntry>(); sut.Text.Should().Be(this.sampleSxFy); sut.TimeStamp.Should().Be(DateTime.ParseExact(ExpectedTimeStamp, LogFileParserExtensions.DateTimeFormat, CultureInfo.InvariantCulture)); sut.TransActionId.Should().Be(ExpectedTransActionId); }
public static void SetupFile(string fileName, int expectedEntryCount) { if (File.Exists(fileName)) { File.Delete(fileName); } using (var file = new StreamWriter(fileName)) { for (var i = 0; i < expectedEntryCount; i++) { var logEntry = new SxFyLogEntry( new List <string> { $"2018-03-26 12:34:10,{i:D3} [9] S1F3 ;Transaction ID=0x{i:X8}", $"{i}" }); file.WriteLine(logEntry.ToString()); } } }