public void IfBufferIsEmptyShouldTransitionToTerminate()
        {
            EventBuffer buffer = new EventBufferBuilder().Build();

            ITask start = new QueryingEvents();
            ITask end = start.Execute(new InMemoryFileSystem(), buffer, new FeedBuilder(SampleLinks.Instance), (args => { }));

            Assert.IsInstanceOf(typeof (Terminate), end);
        }
        public void IfBufferContainsEventsShouldTransitionToIdentifyingCurrentFeed()
        {
            int eventCount = 2;
            EventBuffer buffer = new EventBufferBuilder().WithNumberOfEvents(eventCount).Build();

            ITask start = new QueryingEvents();
            ITask end = start.Execute(new InMemoryFileSystem(), buffer, new FeedBuilder(SampleLinks.Instance), (args => { }));

            Assert.IsInstanceOf(typeof (IdentifyingRecentEventsFeed), end);
            Assert.AreEqual(eventCount, end.GetEvents().Count());
        }
        private void WriteFeed()
        {
            timer.Stop();

            ITask task = new QueryingEvents();
            while (!task.IsLastTask)
            {
                task = task.Execute(fileSystem, buffer, feedBuilder, NotifyMappingsChanged);
            }

            timer.Start();
        }