예제 #1
0
 public void TestGetLine_NoSource()
 {
     using (var proxy = new LogSourceProxy(_taskScheduler, TimeSpan.Zero, null))
     {
         var entry = proxy.GetEntry(0);
         entry.Index.Should().Be(LogLineIndex.Invalid);
     }
 }
예제 #2
0
        public void TestGetEntry()
        {
            var source = new InMemoryLogSource();

            source.AddEntry("I'm an english man in new york");
            using (var proxy = new LogSourceProxy(_taskScheduler, TimeSpan.Zero, source))
            {
                var entry = proxy.GetEntry(0);
                entry.RawContent.Should().Be("I'm an english man in new york");
            }
        }
예제 #3
0
        public void TestEmptyConstruction()
        {
            using (var proxy = new LogSourceProxy(_taskScheduler, TimeSpan.Zero))
            {
                proxy.InnerLogSource.Should().BeNull();
                proxy.GetProperty(TextProperties.MaxCharactersInLine).Should().Be(0);
                proxy.GetProperty(Core.Properties.EmptyReason).Should().Be(null);
                proxy.GetProperty(Core.Properties.Size).Should().BeNull();
                proxy.GetProperty(Core.Properties.StartTimestamp).Should().NotHaveValue();
                proxy.GetProperty(Core.Properties.EndTimestamp).Should().NotHaveValue();
                proxy.GetProperty(Core.Properties.LogEntryCount).Should().Be(0);
                proxy.Columns.Should().Equal(Core.Columns.Minimum);

                proxy.GetEntry(0).Index.Should().Be(LogLineIndex.Invalid);
            }
        }