예제 #1
0
        public void TestAddEntry1()
        {
            var table = new InMemoryLogTable();

            table.AddEntry(new LogEntry());
            table.Count.Should().Be(1);
        }
예제 #2
0
 private void ExtractEventsFrom(LogLine[] logLines, int count)
 {
     for (var i = 0; i < count; ++i)
     {
         var logLine  = logLines[i];
         var captures = TryExtractEventFrom(logLine);
         if (captures != null)
         {
             _events.AddEntry(CreateEvent(captures, logLine));
             _indices.Add(logLine.LineIndex);
         }
     }
 }
예제 #3
0
        public void TestAddEntry3()
        {
            var table = new InMemoryLogTable();

            table.AddListener(_listener.Object, TimeSpan.Zero, 1);
            table.AddEntry(new LogEntry());
            _modifications.Should()
            .Equal(new object[]
            {
                LogTableModification.Reset,
                new LogTableModification(0, 1)
            });
        }
예제 #4
0
        public void TestAddEntry2()
        {
            var table = new InMemoryLogTable(new ColumnHeader("Name"));

            table.AddEntry(new LogEntry("Foo"));
            var task = table[0];

            task.Should().NotBeNull();
            task.Wait(TimeSpan.FromSeconds(1));
            var entry = task.Result;

            entry.Fields.Should().Equal(new object[] { "Foo" });
        }