コード例 #1
0
        public void TestReadAll1()
        {
            using (var file = new TextLogFile(_scheduler, File20Mb))
            {
                file.Property(x => x.EndOfSourceReached).ShouldAfter(TimeSpan.FromSeconds(20)).BeTrue();

                file.Dispose();

                file.GetValue(LogFileProperties.StartTimestamp).Should().Be(new DateTime(2015, 10, 7, 19, 50, 58, 982));

                List <LogLine> entries = file.Entries.ToList();
                entries.Count.Should().Be(165342);
                entries[0].Should()
                .Be(new LogLine(0,
                                "2015-10-07 19:50:58,982 [8092, 1] INFO  SharpRemote.Hosting.OutOfProcessSiloServer (null) - Silo Server starting, args (1): \"14056\", without custom type resolver",
                                LevelFlags.Info, new DateTime(2015, 10, 7, 19, 50, 58, 982)));
                entries[entries.Count - 1].Should()
                .Be(new LogLine(165341,
                                "2015-10-07 19:51:42,483 [8092, 6] INFO  SharpRemote.Hosting.OutOfProcessSiloServer (null) - Parent process terminated unexpectedly (exit code: -1), shutting down...",
                                LevelFlags.Info, new DateTime(2015, 10, 7, 19, 51, 42, 483)));
            }
        }