public TestController(IStatisticsFilterFactory statisticsFilterFactory, IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser, IBestPerformanceInAMatchStatisticsDataSource statisticsDataSource, UmbracoHelper umbracoHelper, string queryString) : base( Mock.Of <IGlobalSettings>(), Mock.Of <IUmbracoContextAccessor>(), null, AppCaches.NoCache, Mock.Of <IProfilingLogger>(), umbracoHelper, statisticsFilterFactory, statisticsDataSource, Mock.Of <IStatisticsBreadcrumbBuilder>(), statisticsFilterQueryStringParser, Mock.Of <IStatisticsFilterHumanizer>()) { var request = new Mock <HttpRequestBase>(); request.SetupGet(x => x.Url).Returns(_requestUrl); request.SetupGet(x => x.RawUrl).Returns(_requestUrl.PathAndQuery); request.SetupGet(x => x.QueryString).Returns(HttpUtility.ParseQueryString(queryString)); 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 TestController(ICompetitionDataSource competitionDataSource, IBestPerformanceInAMatchStatisticsDataSource bestPerformanceDataSource, IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser, UmbracoHelper umbracoHelper) : base( Mock.Of <IGlobalSettings>(), Mock.Of <IUmbracoContextAccessor>(), null, AppCaches.NoCache, Mock.Of <IProfilingLogger>(), umbracoHelper, competitionDataSource, bestPerformanceDataSource, 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 SeasonStatisticsController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ServiceContext serviceContext, AppCaches appCaches, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, ISeasonDataSource seasonDataSource, IBestPerformanceInAMatchStatisticsDataSource bestPerformanceDataSource, IBestPlayerTotalStatisticsDataSource bestPlayerTotalDataSource) : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper) { _seasonDataSource = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource)); _bestPerformanceDataSource = bestPerformanceDataSource ?? throw new ArgumentNullException(nameof(bestPerformanceDataSource)); _bestPlayerTotalDataSource = bestPlayerTotalDataSource ?? throw new ArgumentNullException(nameof(bestPlayerTotalDataSource)); }
public StatisticsController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ServiceContext serviceContext, AppCaches appCaches, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IBestPerformanceInAMatchStatisticsDataSource bestPerformanceInAMatchStatisticsDataSource, IBestPlayerTotalStatisticsDataSource bestTotalStatisticsDataSource, IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser, IStatisticsFilterHumanizer statisticsFilterHumanizer) : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper) { _bestPerformanceInAMatchStatisticsDataSource = bestPerformanceInAMatchStatisticsDataSource ?? throw new ArgumentNullException(nameof(bestPerformanceInAMatchStatisticsDataSource)); _bestTotalStatisticsDataSource = bestTotalStatisticsDataSource ?? throw new ArgumentNullException(nameof(bestTotalStatisticsDataSource)); _statisticsFilterQueryStringParser = statisticsFilterQueryStringParser ?? throw new ArgumentNullException(nameof(statisticsFilterQueryStringParser)); _statisticsFilterHumanizer = statisticsFilterHumanizer ?? throw new ArgumentNullException(nameof(statisticsFilterHumanizer)); }
public BowlingFiguresController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ServiceContext serviceContext, AppCaches appCaches, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IStatisticsFilterFactory statisticsFilterFactory, IBestPerformanceInAMatchStatisticsDataSource statisticsDataSource, IStatisticsBreadcrumbBuilder statisticsBreadcrumbBuilder, IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser, IStatisticsFilterHumanizer statisticsFilterHumanizer) : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper) { _statisticsFilterFactory = statisticsFilterFactory ?? throw new ArgumentNullException(nameof(statisticsFilterFactory)); _statisticsDataSource = statisticsDataSource ?? throw new ArgumentNullException(nameof(statisticsDataSource)); _statisticsBreadcrumbBuilder = statisticsBreadcrumbBuilder ?? throw new ArgumentNullException(nameof(statisticsBreadcrumbBuilder)); _statisticsFilterQueryStringParser = statisticsFilterQueryStringParser ?? throw new ArgumentNullException(nameof(statisticsFilterQueryStringParser)); _statisticsFilterHumanizer = statisticsFilterHumanizer ?? throw new ArgumentNullException(nameof(statisticsFilterHumanizer)); }