Ejemplo n.º 1
0
        public void TestInsertOneEntry()
        {
            var entries = new LogBufferList(Core.Columns.DeltaTime);

            entries.Insert(0, ReadOnlyLogEntry.Create(new[] { Core.Columns.DeltaTime },
                                                      new object[] { TimeSpan.FromHours(22) }));
            entries.Count.Should().Be(1);
            entries[0].DeltaTime.Should().Be(TimeSpan.FromHours(22));
        }
Ejemplo n.º 2
0
        public void TestInsertInvalidIndex([Values(-2, -1, 1, 42)] int invalidIndex)
        {
            var entries = new LogBufferList(Core.Columns.ElapsedTime);

            var logEntry = ReadOnlyLogEntry.Create(new[] { Core.Columns.ElapsedTime },
                                                   new object[] { TimeSpan.FromHours(22) });

            new Action(() => entries.Insert(invalidIndex, logEntry))
            .Should().Throw <ArgumentOutOfRangeException>();
            entries.Count.Should().Be(0);
        }
Ejemplo n.º 3
0
        public void TestInsertMany()
        {
            var entries = new LogBufferList(Core.Columns.RawContent);

            entries.Insert(0, "r");
            entries.Insert(0, "a");
            entries.Insert(0, "b");
            entries.Insert(0, "o");
            entries.Insert(0, "o");
            entries.Insert(0, "f");

            entries.Count.Should().Be(6);
            entries[0].RawContent.Should().Be("f");
            entries[1].RawContent.Should().Be("o");
            entries[2].RawContent.Should().Be("o");
            entries[3].RawContent.Should().Be("b");
            entries[4].RawContent.Should().Be("a");
            entries[5].RawContent.Should().Be("r");
        }