public TestController(ITeamDataSource teamDataSource, ISeasonDataSource seasonDataSource, ICreateMatchSeasonSelector createMatchSeasonSelector, IEditMatchHelper editMatchHelper, Uri requestUrl,
                                  IAuthorizationPolicy <Competition> competitionAuthorizationPolicy)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    null,
                    teamDataSource,
                    seasonDataSource,
                    createMatchSeasonSelector,
                    editMatchHelper,
                    competitionAuthorizationPolicy)
            {
                var request = new Mock <HttpRequestBase>();

                request.SetupGet(x => x.RawUrl).Returns(requestUrl.AbsolutePath);

                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(IMatchDataSource matchDataSource, ISeasonDataSource seasonDataSource, IEditMatchHelper editMatchHelper, Uri requestUrl, UmbracoHelper umbracoHelper,
                                  IAuthorizationPolicy <Stoolball.Matches.Match> matchAuthorizationPolicy, IAuthorizationPolicy <Competition> competitionAuthorizationPolicy)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    matchDataSource,
                    matchAuthorizationPolicy,
                    competitionAuthorizationPolicy,
                    Mock.Of <IDateTimeFormatter>(),
                    seasonDataSource,
                    editMatchHelper)
            {
                var request = new Mock <HttpRequestBase>();

                request.SetupGet(x => x.Url).Returns(requestUrl);

                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(ITournamentDataSource tournamentDataSource, ISeasonDataSource seasonDataSource, Uri requestUrl, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    tournamentDataSource,
                    seasonDataSource,
                    Mock.Of <IAuthorizationPolicy <Tournament> >(),
                    Mock.Of <ISeasonEstimator>(),
                    Mock.Of <IDateTimeFormatter>())
            {
                var request = new Mock <HttpRequestBase>();

                request.SetupGet(x => x.Url).Returns(requestUrl);

                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(ISeasonDataSource seasonDataSource, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    seasonDataSource,
                    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);

                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(ITeamDataSource teamDataSource, ISeasonDataSource seasonDataSource, Uri requestUrl)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    null,
                    teamDataSource,
                    seasonDataSource)
            {
                var request = new Mock <HttpRequestBase>();

                request.SetupGet(x => x.RawUrl).Returns(requestUrl.AbsolutePath);

                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 EditSeasonSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                    AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, ISeasonDataSource seasonDataSource,
                                    ISeasonRepository seasonRepository, IAuthorizationPolicy <Competition> authorizationPolicy)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _seasonDataSource    = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _seasonRepository    = seasonRepository ?? throw new ArgumentNullException(nameof(seasonRepository));
     _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
 }
 public CreateTournamentSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                          AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, ITournamentRepository tournamentRepository,
                                          ITeamDataSource teamDataSource, ISeasonDataSource seasonDataSource, IMatchValidator matchValidator, ICacheClearer <Tournament> cacheClearer)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _tournamentRepository = tournamentRepository ?? throw new ArgumentNullException(nameof(tournamentRepository));
     _teamDataSource       = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _seasonDataSource     = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _matchValidator       = matchValidator ?? throw new ArgumentNullException(nameof(matchValidator));
     _cacheClearer         = cacheClearer ?? throw new ArgumentNullException(nameof(cacheClearer));
 }
 public SeasonMapController(IGlobalSettings globalSettings,
                            IUmbracoContextAccessor umbracoContextAccessor,
                            ServiceContext serviceContext,
                            AppCaches appCaches,
                            IProfilingLogger profilingLogger,
                            UmbracoHelper umbracoHelper,
                            ISeasonDataSource seasonDataSource,
                            IApiKeyProvider apiKeyProvider)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _seasonDataSource = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _apiKeyProvider   = apiKeyProvider ?? throw new ArgumentNullException(nameof(apiKeyProvider));
 }
Пример #9
0
 public CreateTournamentController(IGlobalSettings globalSettings,
                                   IUmbracoContextAccessor umbracoContextAccessor,
                                   ServiceContext serviceContext,
                                   AppCaches appCaches,
                                   IProfilingLogger profilingLogger,
                                   UmbracoHelper umbracoHelper,
                                   ITeamDataSource teamDataSource,
                                   ISeasonDataSource seasonDataSource)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _teamDataSource   = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _seasonDataSource = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
 }
Пример #10
0
 public EditSeasonController(IGlobalSettings globalSettings,
                             IUmbracoContextAccessor umbracoContextAccessor,
                             ServiceContext serviceContext,
                             AppCaches appCaches,
                             IProfilingLogger profilingLogger,
                             UmbracoHelper umbracoHelper,
                             ISeasonDataSource seasonDataSource,
                             IAuthorizationPolicy <Competition> authorizationPolicy)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _seasonDataSource    = seasonDataSource ?? throw new System.ArgumentNullException(nameof(seasonDataSource));
     _authorizationPolicy = authorizationPolicy ?? throw new System.ArgumentNullException(nameof(authorizationPolicy));
 }
Пример #11
0
 public CreateLeagueMatchSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                           AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IMatchRepository matchRepository, ITeamDataSource teamDataSource,
                                           ISeasonDataSource seasonDataSource, ICreateMatchSeasonSelector createMatchSeasonSelector, IEditMatchHelper editMatchHelper, IMatchValidator matchValidator,
                                           ICacheClearer <Match> cacheClearer)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _matchRepository           = matchRepository ?? throw new ArgumentNullException(nameof(matchRepository));
     _teamDataSource            = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _seasonDataSource          = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _createMatchSeasonSelector = createMatchSeasonSelector ?? throw new ArgumentNullException(nameof(createMatchSeasonSelector));
     _editMatchHelper           = editMatchHelper ?? throw new ArgumentNullException(nameof(editMatchHelper));
     _matchValidator            = matchValidator ?? throw new ArgumentNullException(nameof(matchValidator));
     _cacheClearer = cacheClearer ?? throw new ArgumentNullException(nameof(cacheClearer));
 }
Пример #12
0
 public EditStartOfPlaySurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                         AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IMatchDataSource matchDataSource,
                                         IMatchRepository matchRepository, ISeasonDataSource seasonDataSource, IAuthorizationPolicy <Match> authorizationPolicy, IDateTimeFormatter dateTimeFormatter,
                                         IEditMatchHelper editMatchHelper, ICacheClearer <Match> cacheClearer)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _matchDataSource     = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _matchRepository     = matchRepository ?? throw new ArgumentNullException(nameof(matchRepository));
     _seasonDataSource    = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _dateTimeFormatter   = dateTimeFormatter ?? throw new ArgumentNullException(nameof(dateTimeFormatter));
     _editMatchHelper     = editMatchHelper ?? throw new ArgumentNullException(nameof(editMatchHelper));
     _cacheClearer        = cacheClearer ?? throw new ArgumentNullException(nameof(cacheClearer));
 }
 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 CreateTrainingSessionController(IGlobalSettings globalSettings,
                                        IUmbracoContextAccessor umbracoContextAccessor,
                                        ServiceContext serviceContext,
                                        AppCaches appCaches,
                                        IProfilingLogger profilingLogger,
                                        UmbracoHelper umbracoHelper,
                                        ITeamDataSource teamDataSource,
                                        ISeasonDataSource seasonDataSource,
                                        ICreateMatchSeasonSelector createMatchSeasonSelector,
                                        IEditMatchHelper editMatchHelper)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _teamDataSource            = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _seasonDataSource          = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _createMatchSeasonSelector = createMatchSeasonSelector ?? throw new ArgumentNullException(nameof(createMatchSeasonSelector));
     _editMatchHelper           = editMatchHelper ?? throw new ArgumentNullException(nameof(editMatchHelper));
 }
Пример #15
0
 public EditTrainingSessionController(IGlobalSettings globalSettings,
                                      IUmbracoContextAccessor umbracoContextAccessor,
                                      ServiceContext serviceContext,
                                      AppCaches appCaches,
                                      IProfilingLogger profilingLogger,
                                      UmbracoHelper umbracoHelper,
                                      IMatchDataSource matchDataSource,
                                      IAuthorizationPolicy <Match> authorizationPolicy,
                                      IDateTimeFormatter dateFormatter,
                                      ISeasonDataSource seasonDataSource)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchDataSource     = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _dateFormatter       = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter));
     _seasonDataSource    = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
 }
Пример #16
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));
 }
Пример #17
0
 public EditTournamentSeasonsController(IGlobalSettings globalSettings,
                                        IUmbracoContextAccessor umbracoContextAccessor,
                                        ServiceContext serviceContext,
                                        AppCaches appCaches,
                                        IProfilingLogger profilingLogger,
                                        UmbracoHelper umbracoHelper,
                                        ITournamentDataSource tournamentDataSource,
                                        ISeasonDataSource seasonDataSource,
                                        IAuthorizationPolicy <Tournament> authorizationPolicy,
                                        ISeasonEstimator seasonEstimator,
                                        IDateTimeFormatter dateFormatter)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _tournamentDataSource = tournamentDataSource ?? throw new ArgumentNullException(nameof(tournamentDataSource));
     _seasonDataSource     = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _authorizationPolicy  = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _seasonEstimator      = seasonEstimator ?? throw new ArgumentNullException(nameof(seasonEstimator));
     _dateFormatter        = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter));
 }
 public SeasonResultsTableController(IGlobalSettings globalSettings,
                                     IUmbracoContextAccessor umbracoContextAccessor,
                                     ServiceContext serviceContext,
                                     AppCaches appCaches,
                                     IProfilingLogger profilingLogger,
                                     UmbracoHelper umbracoHelper,
                                     ISeasonDataSource seasonDataSource,
                                     IMatchListingDataSource matchDataSource,
                                     IAuthorizationPolicy <Competition> authorizationPolicy,
                                     IEmailProtector emailProtector,
                                     IDateTimeFormatter dateTimeFormatter
                                     )
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _seasonDataSource    = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _matchDataSource     = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _emailProtector      = emailProtector ?? throw new ArgumentNullException(nameof(emailProtector));
     _dateTimeFormatter   = dateTimeFormatter ?? throw new ArgumentNullException(nameof(dateTimeFormatter));
 }
 public EditLeagueMatchController(IGlobalSettings globalSettings,
                                  IUmbracoContextAccessor umbracoContextAccessor,
                                  ServiceContext serviceContext,
                                  AppCaches appCaches,
                                  IProfilingLogger profilingLogger,
                                  UmbracoHelper umbracoHelper,
                                  IMatchDataSource matchDataSource,
                                  IAuthorizationPolicy <Match> matchAuthorizationPolicy,
                                  IAuthorizationPolicy <Competition> competitionAuthorizationPolicy,
                                  IDateTimeFormatter dateFormatter,
                                  ISeasonDataSource seasonDataSource,
                                  IEditMatchHelper editMatchHelper)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchDataSource                = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _authorizationPolicy            = matchAuthorizationPolicy ?? throw new ArgumentNullException(nameof(matchAuthorizationPolicy));
     _competitionAuthorizationPolicy = competitionAuthorizationPolicy ?? throw new ArgumentNullException(nameof(competitionAuthorizationPolicy));
     _dateFormatter    = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter));
     _seasonDataSource = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _editMatchHelper  = editMatchHelper ?? throw new ArgumentNullException(nameof(editMatchHelper));
 }
            public TestController(ISeasonDataSource seasonDataSource, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    seasonDataSource,
                    Mock.Of <IAuthorizationPolicy <Competition> >())
            {
                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);
            }
Пример #21
0
 public EditMatchHelper(ISeasonDataSource seasonDataSource)
 {
     _seasonDataSource = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
 }
 public SeasonsApiController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext serviceContext,
                             AppCaches appCaches, IProfilingLogger profilingLogger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, UmbracoMapper umbracoMapper, ISeasonDataSource seasonDataSource) :
     base(globalSettings, umbracoContextAccessor, sqlContext, serviceContext, appCaches, profilingLogger, runtimeState, umbracoHelper, umbracoMapper)
 {
     _seasonDataSource = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
 }