Пример #1
0
        /// <inheritdoc />
        public void OnLogFileModified(ILogFile logFile, LogFileSection section)
        {
            Log.DebugFormat("OnLogFileModified({0})", section);

            _pendingModifications.EnqueueMany(section.Split(MaximumBatchSize));
            ResetEndOfSourceReached();
        }
Пример #2
0
        public void TestSplitAppendTwoParts([Values(0, 1, 99, 100)] int count)
        {
            int maxCount = count + 1;
            var section  = new LogFileSection(new LogLineIndex(0), count);

            section.Split(maxCount).Should().Equal(new[]
            {
                section
            }, "because we append less than the maximum number of lines");
        }
Пример #3
0
        public void TestSplitAppendThreePartsPartial()
        {
            var section = new LogFileSection(new LogLineIndex(101), 67);

            section.Split(33).Should().Equal(new[]
            {
                new LogFileSection(101, 33),
                new LogFileSection(134, 33),
                new LogFileSection(167, 1)
            }, "because we append less than the maximum number of lines");
        }