private void AddMultipleTrackersStatisticsProvider(IServiceCollection services) { var statisticsProvider = new MultipleTrackersFactProvider(); statisticsProvider.Add(new MostEventfulWeekCalculator()); statisticsProvider.Add(new MostEventfulDayCalculator()); statisticsProvider.Add(new MostFrequentEventStatisticsCalculator()); statisticsProvider.Add(new MultipleTrackersEventsCountCalculator()); services.AddSingleton <IMultipleTrackersFactProvider>(statisticsProvider); }
private StatisticGenerator InitializeStatisticGeneratorWithTwoCalculators() { var generalFactProvider = new MultipleTrackersFactProvider(); generalFactProvider.Add(new MostEventfulDayCalculator()); var specificFactProvider = new SingleTrackerFactProvider(); specificFactProvider.Add(new SingleTrackerEventsCountCalculator()); _singleFactsRepository = new SingleFactsRepository(); _multipleFactsRepository = new MultipleFactsRepository(); _trackerRepository = new TrackerRepository(); _eventRepository = new EventRepository(); return(new StatisticGenerator(_multipleFactsRepository, generalFactProvider, specificFactProvider, _singleFactsRepository, _trackerRepository, _eventRepository)); }