Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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());
                }
            }
        }