public MatchesCalendarController(IGlobalSettings globalSettings,
                                  IUmbracoContextAccessor umbracoContextAccessor,
                                  ServiceContext serviceContext,
                                  AppCaches appCaches,
                                  IProfilingLogger profilingLogger,
                                  UmbracoHelper umbracoHelper,
                                  IClubDataSource clubDataSource,
                                  ITeamDataSource teamDataSource,
                                  ICompetitionDataSource competitionDataSource,
                                  IMatchLocationDataSource matchLocationDataSource,
                                  IMatchListingDataSource matchListingDataSource,
                                  ITournamentDataSource tournamentDataSource,
                                  IMatchDataSource matchDataSource,
                                  IDateTimeFormatter dateFormatter,
                                  IMatchFilterQueryStringParser matchFilterQueryStringParser,
                                  IMatchFilterHumanizer matchFilterHumanizer)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _clubDataSource               = clubDataSource ?? throw new ArgumentNullException(nameof(clubDataSource));
     _teamDataSource               = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _competitionDataSource        = competitionDataSource ?? throw new ArgumentNullException(nameof(competitionDataSource));
     _matchLocationDataSource      = matchLocationDataSource ?? throw new ArgumentNullException(nameof(matchLocationDataSource));
     _matchListingDataSource       = matchListingDataSource ?? throw new ArgumentNullException(nameof(matchListingDataSource));
     _tournamentDataSource         = tournamentDataSource ?? throw new ArgumentNullException(nameof(tournamentDataSource));
     _matchDataSource              = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _dateFormatter                = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter));
     _matchFilterQueryStringParser = matchFilterQueryStringParser ?? throw new ArgumentNullException(nameof(matchFilterQueryStringParser));
     _matchFilterHumanizer         = matchFilterHumanizer ?? throw new ArgumentNullException(nameof(matchFilterHumanizer));
 }
 public MatchLocationsApiController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext serviceContext,
                                    AppCaches appCaches, IProfilingLogger profilingLogger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper,
                                    IMatchLocationDataSource locationDataSource) :
     base(globalSettings, umbracoContextAccessor, sqlContext, serviceContext, appCaches, profilingLogger, runtimeState, umbracoHelper, umbracoMapper)
 {
     _locationDataSource = locationDataSource ?? throw new ArgumentNullException(nameof(locationDataSource));
 }
            public TestController(IMatchLocationDataSource matchLocationDataSource,
                                  IBestPerformanceInAMatchStatisticsDataSource bestPerformanceDataSource,
                                  IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser,
                                  UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    matchLocationDataSource,
                    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;
            }
Пример #4
0
            public TestController(IMatchLocationDataSource matchLocationDataSource, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    matchLocationDataSource,
                    Mock.Of <IAuthorizationPolicy <MatchLocation> >(),
                    Mock.Of <IApiKeyProvider>(), Mock.Of <IEmailProtector>())
            {
                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;
            }
Пример #5
0
            public TestController(IMatchLocationDataSource matchLocationDataSource, IMatchListingDataSource matchDataSource, IMatchFilterQueryStringParser matchFilterQueryStringParser, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    Mock.Of <IMatchFilterFactory>(),
                    matchLocationDataSource,
                    matchDataSource,
                    Mock.Of <IAuthorizationPolicy <MatchLocation> >(),
                    Mock.Of <IDateTimeFormatter>(),
                    matchFilterQueryStringParser,
                    Mock.Of <IMatchFilterHumanizer>())
            {
                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);

                ControllerContext = new ControllerContext(context.Object, new RouteData(), this);
            }
 public EditMatchLocationSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                           AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IMatchLocationDataSource matchLocationDataSource,
                                           IMatchLocationRepository matchLocationRepository, IAuthorizationPolicy <MatchLocation> authorizationPolicy, ICacheOverride cacheOverride)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _matchLocationDataSource = matchLocationDataSource ?? throw new System.ArgumentNullException(nameof(matchLocationDataSource));
     _matchLocationRepository = matchLocationRepository ?? throw new System.ArgumentNullException(nameof(matchLocationRepository));
     _authorizationPolicy     = authorizationPolicy ?? throw new System.ArgumentNullException(nameof(authorizationPolicy));
     _cacheOverride           = cacheOverride ?? throw new ArgumentNullException(nameof(cacheOverride));
 }
        private TestController CreateController(
            IMatchLocationDataSource dataSource,
            IListingsModelBuilder <MatchLocation, MatchLocationFilter, MatchLocationsViewModel> listingsBuilder)
        {
            var controller = new TestController(dataSource, listingsBuilder);

            base.Request.SetupGet(x => x.Url).Returns(_pageUrl);
            base.Request.SetupGet(x => x.QueryString).Returns(_queryString);
            controller.ControllerContext = new ControllerContext(base.HttpContext.Object, new RouteData(), controller);

            return(controller);
        }
Пример #8
0
 public MatchLocationActionsController(IGlobalSettings globalSettings,
                                       IUmbracoContextAccessor umbracoContextAccessor,
                                       ServiceContext serviceContext,
                                       AppCaches appCaches,
                                       IProfilingLogger profilingLogger,
                                       UmbracoHelper umbracoHelper,
                                       IMatchLocationDataSource matchLocationDataSource,
                                       IAuthorizationPolicy <MatchLocation> authorizationPolicy)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchLocationDataSource = matchLocationDataSource ?? throw new System.ArgumentNullException(nameof(matchLocationDataSource));
     _authorizationPolicy     = authorizationPolicy ?? throw new System.ArgumentNullException(nameof(authorizationPolicy));
 }
Пример #9
0
 public MatchLocationsController(IGlobalSettings globalSettings,
                                 IUmbracoContextAccessor umbracoContextAccessor,
                                 ServiceContext serviceContext,
                                 AppCaches appCaches,
                                 IProfilingLogger profilingLogger,
                                 UmbracoHelper umbracoHelper,
                                 IMatchLocationDataSource matchLocationDataSource,
                                 IListingsModelBuilder <MatchLocation, MatchLocationFilter, MatchLocationsViewModel> listingsModelBuilder)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchLocationDataSource = matchLocationDataSource ?? throw new System.ArgumentNullException(nameof(matchLocationDataSource));
     _listingsModelBuilder    = listingsModelBuilder ?? throw new System.ArgumentNullException(nameof(listingsModelBuilder));
 }
 public TestController(
     IMatchLocationDataSource matchLocationDataSource,
     IListingsModelBuilder <MatchLocation, MatchLocationFilter, MatchLocationsViewModel> listingsModelBuilder)
     : base(
         Mock.Of <IGlobalSettings>(),
         Mock.Of <IUmbracoContextAccessor>(),
         null,
         AppCaches.NoCache,
         Mock.Of <IProfilingLogger>(),
         null,
         matchLocationDataSource,
         listingsModelBuilder)
 {
 }
Пример #11
0
 public MatchLocationStatisticsController(IGlobalSettings globalSettings,
                                          IUmbracoContextAccessor umbracoContextAccessor,
                                          ServiceContext serviceContext,
                                          AppCaches appCaches,
                                          IProfilingLogger profilingLogger,
                                          UmbracoHelper umbracoHelper,
                                          IMatchLocationDataSource matchLocationDataSource,
                                          IBestPerformanceInAMatchStatisticsDataSource bestPerformanceDataSource,
                                          IBestPlayerTotalStatisticsDataSource bestPlayerTotalDataSource,
                                          IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser,
                                          IStatisticsFilterHumanizer statisticsFilterHumanizer)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchLocationDataSource           = matchLocationDataSource ?? throw new ArgumentNullException(nameof(matchLocationDataSource));
     _bestPerformanceDataSource         = bestPerformanceDataSource ?? throw new ArgumentNullException(nameof(bestPerformanceDataSource));
     _bestPlayerTotalDataSource         = bestPlayerTotalDataSource ?? throw new ArgumentNullException(nameof(bestPlayerTotalDataSource));
     _statisticsFilterQueryStringParser = statisticsFilterQueryStringParser ?? throw new ArgumentNullException(nameof(statisticsFilterQueryStringParser));
     _statisticsFilterHumanizer         = statisticsFilterHumanizer ?? throw new ArgumentNullException(nameof(statisticsFilterHumanizer));
 }
Пример #12
0
 public StatisticsFilterFactory(
     IStoolballEntityRouteParser stoolballEntityRouteParser,
     IPlayerDataSource playerDataSource,
     IClubDataSource clubDataSource,
     ITeamDataSource teamDataSource,
     IMatchLocationDataSource matchLocationDataSource,
     ICompetitionDataSource competitionDataSource,
     ISeasonDataSource seasonDataSource,
     IRouteNormaliser routeNormaliser)
 {
     _stoolballEntityRouteParser = stoolballEntityRouteParser ?? throw new ArgumentNullException(nameof(stoolballEntityRouteParser));
     _playerDataSource           = playerDataSource ?? throw new ArgumentNullException(nameof(playerDataSource));
     _clubDataSource             = clubDataSource ?? throw new ArgumentNullException(nameof(clubDataSource));
     _teamDataSource             = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _matchLocationDataSource    = matchLocationDataSource ?? throw new ArgumentNullException(nameof(matchLocationDataSource));
     _competitionDataSource      = competitionDataSource ?? throw new ArgumentNullException(nameof(competitionDataSource));
     _seasonDataSource           = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _routeNormaliser            = routeNormaliser ?? throw new ArgumentNullException(nameof(routeNormaliser));
 }
Пример #13
0
            public TestController(IMatchLocationDataSource matchLocationDataSource, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    matchLocationDataSource,
                    Mock.Of <IAuthorizationPolicy <MatchLocation> >(),
                    Mock.Of <IApiKeyProvider>())
            {
                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);

                ControllerContext = new ControllerContext(context.Object, new RouteData(), this);
            }
 public MatchesForMatchLocationController(IGlobalSettings globalSettings,
                                          IUmbracoContextAccessor umbracoContextAccessor,
                                          ServiceContext serviceContext,
                                          AppCaches appCaches,
                                          IProfilingLogger profilingLogger,
                                          UmbracoHelper umbracoHelper,
                                          IMatchFilterFactory matchFilterFactory,
                                          IMatchLocationDataSource matchLocationDataSource,
                                          IMatchListingDataSource matchDataSource,
                                          IAuthorizationPolicy <MatchLocation> authorizationPolicy,
                                          IDateTimeFormatter dateFormatter,
                                          IMatchFilterQueryStringParser matchFilterQueryStringParser,
                                          IMatchFilterHumanizer matchFilterHumanizer)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchFilterFactory           = matchFilterFactory ?? throw new ArgumentNullException(nameof(matchFilterFactory));
     _matchLocationDataSource      = matchLocationDataSource ?? throw new ArgumentNullException(nameof(matchLocationDataSource));
     _matchDataSource              = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _authorizationPolicy          = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _dateFormatter                = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter));
     _matchFilterQueryStringParser = matchFilterQueryStringParser ?? throw new ArgumentNullException(nameof(matchFilterQueryStringParser));
     _matchFilterHumanizer         = matchFilterHumanizer ?? throw new ArgumentNullException(nameof(matchFilterHumanizer));
 }