protected virtual void SetupStubs()
        {
            _webClient.Stub(client => client.OpenRead(_syncItem.EpisodeUrl)).Return(_stream);
            _webClientFactory.Stub(factory => factory.CreateWebClient()).Return(_webClient);
            _directoryInfoProvider.Stub(dir => dir.GetDirectoryInfo(_downloadFolder)).Return(_directoryInfo);
            _stateProvider.Stub(provider => provider.GetState(_syncItem.StateKey)).Return(_state);

            _counterFactory.Stub(
                factory => factory.CreateAverageCounter(CategoryInstaller.PodcastUtilitiesCommonCounterCategory,
                                                        CategoryInstaller.AverageMBDownload,
                                                        CategoryInstaller.SizeOfDownloads))
            .Return(_averageCounterSize);
            _counterFactory.Stub(
                factory => factory.CreateAverageCounter(CategoryInstaller.PodcastUtilitiesCommonCounterCategory,
                                                        CategoryInstaller.AverageTimeToDownload,
                                                        CategoryInstaller.NumberOfDownloads))
            .Return(_averageCounterTime);
        }
        protected virtual void SetupStubs(bool throwErrorFromFeed)
        {
            _timeProvider.Stub(time => time.UtcNow).Return(_now);
            _webClient.Stub(client => client.OpenRead(_feedInfo.Address)).Return(_stream);
            _webClientFactory.Stub(factory => factory.CreateWebClient()).Return(_webClient);
            _feedFactory.Stub(factory => factory.CreatePodcastFeed(_feedInfo.Format.Value, _stream, null)).Return(_podcastFeed);
            if (throwErrorFromFeed)
            {
                _podcastFeed.Stub(feed => feed.Episodes).Throw(new Exception("ERROR"));
            }
            else
            {
                _podcastFeed.Stub(feed => feed.Episodes).Return(_podcastFeedItems);
            }
            _stateProvider.Stub(provider => provider.GetState(Path.Combine(_rootFolder, _podcastInfo.Folder))).Return(_state);
            _directoryInfoProvider.Stub(dir => dir.GetDirectoryInfo(Path.Combine(_rootFolder, _podcastInfo.Folder))).Return(_directoryInfo);

            _commandGenerator.Stub(cmd => cmd.ReplaceTokensInCommand(null, _rootFolder, null, _podcastInfo)).IgnoreArguments().Return(_externalCommand);
        }