public TestController(ITeamDataSource teamDataSource,
                                  IBestPerformanceInAMatchStatisticsDataSource bestPerformanceDataSource,
                                  IInningsStatisticsDataSource inningsStatisticsDataSource,
                                  IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser,
                                  UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    teamDataSource,
                    bestPerformanceDataSource,
                    inningsStatisticsDataSource,
                    Mock.Of <IBestPlayerTotalStatisticsDataSource>(),
                    statisticsFilterQueryStringParser,
                    Mock.Of <IStatisticsFilterHumanizer>())
            {
                var request = new Mock <HttpRequestBase>();

                request.SetupGet(x => x.Url).Returns(new Uri("https://example.org"));

                var context = new Mock <HttpContextBase>();

                context.SetupGet(x => x.Request).Returns(request.Object);

                var controllerContext = new Mock <ControllerContext>();

                controllerContext.Setup(p => p.HttpContext).Returns(context.Object);
                controllerContext.Setup(p => p.HttpContext.User).Returns(new GenericPrincipal(new GenericIdentity("test"), null));
                ControllerContext = controllerContext.Object;
            }
 public TeamStatisticsController(IGlobalSettings globalSettings,
                                 IUmbracoContextAccessor umbracoContextAccessor,
                                 ServiceContext serviceContext,
                                 AppCaches appCaches,
                                 IProfilingLogger profilingLogger,
                                 UmbracoHelper umbracoHelper,
                                 ITeamDataSource teamDataSource,
                                 IBestPerformanceInAMatchStatisticsDataSource bestPerformanceDataSource,
                                 IInningsStatisticsDataSource inningsStatisticsDataSource,
                                 IBestPlayerTotalStatisticsDataSource bestPlayerTotalDataSource,
                                 IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser,
                                 IStatisticsFilterHumanizer statisticsFilterHumanizer)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _teamDataSource                    = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _bestPerformanceDataSource         = bestPerformanceDataSource ?? throw new ArgumentNullException(nameof(bestPerformanceDataSource));
     _inningsStatisticsDataSource       = inningsStatisticsDataSource ?? throw new ArgumentNullException(nameof(inningsStatisticsDataSource));
     _bestPlayerTotalDataSource         = bestPlayerTotalDataSource ?? throw new ArgumentNullException(nameof(bestPlayerTotalDataSource));
     _statisticsFilterQueryStringParser = statisticsFilterQueryStringParser ?? throw new ArgumentNullException(nameof(statisticsFilterQueryStringParser));
     _statisticsFilterHumanizer         = statisticsFilterHumanizer ?? throw new ArgumentNullException(nameof(statisticsFilterHumanizer));
 }