public SearchCoordinator(TweetHuntViewModel viewModel,
                                 SearchConfiguration configuration)
        {
            _model = viewModel;
            _timer = configuration.Timer;
            _searchService = configuration.SearchService;
            
            _model.SearchItems.CollectionChanged += SearchItemsCollectionChanged;
            _timer.Tick += (s, e) => InitiateSearch();
            _searchService.SearchComplete += SearchComplete;

            _minSecondsBetweenItemSearch = configuration.MinSecondsBetweenItemSearch;            
        }
Esempio n. 2
0
 public virtual void Setup()
 {
     SystemTime.Now = () => _now;
     _searchService = new FakeTwitterSearchService();
     _timer = new FakeSearchTimer();
     var configuration = new SearchConfiguration()
     {
         MinSecondsBetweenItemSearch = 300,
         MaxSearchResults = _maxSearchResults,
         SearchService = _searchService,
         Timer = _timer
     };
     _model = new TweetHuntViewModel(configuration);
 }
Esempio n. 3
0
 public TweetHuntViewModel(SearchConfiguration configuration)
 {
     _searchItems   = new SearchItemCollection();
     _searchResults = new SearchResultCollection(configuration.MaxSearchResults);
     _coordinator   = new SearchCoordinator(this, configuration);
 }
 public TweetHuntViewModel(SearchConfiguration configuration)
 {
     _searchItems = new SearchItemCollection();
     _searchResults  = new SearchResultCollection(configuration.MaxSearchResults);
     _coordinator = new SearchCoordinator(this, configuration);
 }