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;
            }
Example #2
0
            public TestController(ICompetitionDataSource competitionDataSource, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    competitionDataSource,
                    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);

                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 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 CreateSeasonSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                      AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, ICompetitionDataSource competitionDataSource,
                                      ISeasonRepository seasonRepository, IAuthorizationPolicy <Competition> authorizationPolicy)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _competitionDataSource = competitionDataSource ?? throw new ArgumentNullException(nameof(competitionDataSource));
     _seasonRepository      = seasonRepository ?? throw new System.ArgumentNullException(nameof(seasonRepository));
     _authorizationPolicy   = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
 }
Example #5
0
 public EditCompetitionSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                         AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, ICompetitionDataSource competitionDataSource,
                                         ICompetitionRepository competitionRepository, IAuthorizationPolicy <Competition> authorizationPolicy, IPostSaveRedirector postSaveRedirector, ICacheOverride cacheOverride)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _competitionDataSource = competitionDataSource ?? throw new ArgumentNullException(nameof(competitionDataSource));
     _competitionRepository = competitionRepository ?? throw new ArgumentNullException(nameof(competitionRepository));
     _authorizationPolicy   = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _postSaveRedirector    = postSaveRedirector ?? throw new ArgumentNullException(nameof(postSaveRedirector));
     _cacheOverride         = cacheOverride ?? throw new ArgumentNullException(nameof(cacheOverride));
 }
Example #6
0
        private TestController CreateController(
            ICompetitionDataSource dataSource,
            IListingsModelBuilder <Competition, CompetitionFilter, CompetitionsViewModel> 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);
        }
 public CompetitionActionsController(IGlobalSettings globalSettings,
                                     IUmbracoContextAccessor umbracoContextAccessor,
                                     ServiceContext serviceContext,
                                     AppCaches appCaches,
                                     IProfilingLogger profilingLogger,
                                     UmbracoHelper umbracoHelper,
                                     ICompetitionDataSource competitionDataSource,
                                     IAuthorizationPolicy <Competition> authorizationPolicy)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _competitionDataSource = competitionDataSource ?? throw new System.ArgumentNullException(nameof(competitionDataSource));
     _authorizationPolicy   = authorizationPolicy ?? throw new System.ArgumentNullException(nameof(authorizationPolicy));
 }
 public CompetitionsController(IGlobalSettings globalSettings,
                               IUmbracoContextAccessor umbracoContextAccessor,
                               ServiceContext serviceContext,
                               AppCaches appCaches,
                               IProfilingLogger profilingLogger,
                               UmbracoHelper umbracoHelper,
                               ICompetitionDataSource competitionDataSource,
                               IListingsModelBuilder <Competition, CompetitionFilter, CompetitionsViewModel> listingsModelBuilder)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _competitionDataSource = competitionDataSource ?? throw new System.ArgumentNullException(nameof(competitionDataSource));
     _listingsModelBuilder  = listingsModelBuilder ?? throw new System.ArgumentNullException(nameof(listingsModelBuilder));
 }
 public DeleteCompetitionSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                           AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, ICompetitionDataSource competitionDataSource,
                                           ICompetitionRepository competitionRepository, IMatchListingDataSource matchDataSource, ITeamDataSource teamDataSource, IAuthorizationPolicy <Competition> authorizationPolicy,
                                           ICacheOverride cacheOverride)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _competitionDataSource = competitionDataSource ?? throw new ArgumentNullException(nameof(competitionDataSource));
     _competitionRepository = competitionRepository ?? throw new ArgumentNullException(nameof(competitionRepository));
     _matchDataSource       = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _teamDataSource        = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _authorizationPolicy   = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _cacheOverride         = cacheOverride ?? throw new ArgumentNullException(nameof(cacheOverride));
 }
Example #10
0
 public TestController(
     ICompetitionDataSource competitionDataSource,
     IListingsModelBuilder <Competition, CompetitionFilter, CompetitionsViewModel> listingsModelBuilder)
     : base(
         Mock.Of <IGlobalSettings>(),
         Mock.Of <IUmbracoContextAccessor>(),
         null,
         AppCaches.NoCache,
         Mock.Of <IProfilingLogger>(),
         null,
         competitionDataSource,
         listingsModelBuilder)
 {
 }
 public DeleteCompetitionController(IGlobalSettings globalSettings,
                                    IUmbracoContextAccessor umbracoContextAccessor,
                                    ServiceContext serviceContext,
                                    AppCaches appCaches,
                                    IProfilingLogger profilingLogger,
                                    UmbracoHelper umbracoHelper,
                                    ICompetitionDataSource competitionDataSource,
                                    IMatchListingDataSource matchDataSource,
                                    ITeamDataSource teamDataSource,
                                    IAuthorizationPolicy <Competition> authorizationPolicy)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _competitionDataSource = competitionDataSource ?? throw new ArgumentNullException(nameof(competitionDataSource));
     _matchDataSource       = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _teamDataSource        = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _authorizationPolicy   = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
 }
 public CompetitionStatisticsController(IGlobalSettings globalSettings,
                                        IUmbracoContextAccessor umbracoContextAccessor,
                                        ServiceContext serviceContext,
                                        AppCaches appCaches,
                                        IProfilingLogger profilingLogger,
                                        UmbracoHelper umbracoHelper,
                                        ICompetitionDataSource competitionDataSource,
                                        IBestPerformanceInAMatchStatisticsDataSource bestPerformanceDataSource,
                                        IBestPlayerTotalStatisticsDataSource bestPlayerTotalDataSource,
                                        IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser,
                                        IStatisticsFilterHumanizer statisticsFilterHumanizer)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _competitionDataSource             = competitionDataSource ?? throw new ArgumentNullException(nameof(competitionDataSource));
     _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));
 }
Example #13
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));
 }
            public TestController(ICompetitionDataSource competitionDataSource, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    competitionDataSource,
                    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);
            }