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);
         }
     }
 }
        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)
            });
        }
        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" });
        }