public void DoesNotConsumeEventsBeyondCompletion()
        {
            using (var file1 = new StringLogFile("sample-1-a", Sample1))
                using (var file2 = new StringLogFile("sample-1-b", Sample1))
                {
                    var statsProvider = new LogFileStatsCache();
                    var query         = new SimpleLogQuery
                    {
                        Quantity = statsProvider.GetStats(file1, null).EventCount
                    };

                    file1.InitializeStats(query, statsProvider);
                    file2.InitializeStats(query, statsProvider);

                    var subject = new LogAccumulator(statsProvider, query);

                    var actual = subject
                                 .Consume(file1)
                                 .Consume(file2);

                    Assert.That(file1.WasRead, Is.True);
                    Assert.That(file2.WasRead, Is.False);

                    Assert.That(actual.Events, Is.EqualTo(Sample1Events));
                }
        }
        public void DoesNotConsumeEventsZeroQuantity()
        {
            using (var file = new StringLogFile("sample-1", Sample1))
            {
                var statsProvider = new LogFileStatsCache();
                var query         = new SimpleLogQuery
                {
                    Quantity = 0
                };

                file.InitializeStats(query, statsProvider);

                var subject = new LogAccumulator(statsProvider, query);
                Assert.That(subject.IsComplete);

                var actual = subject.Consume(file);

                Assert.That(file.WasRead, Is.False);
                Assert.That(actual.Events, Is.Empty);
            }
        }