コード例 #1
0
 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));
 }
コード例 #2
0
 public MatchesForTeamController(IGlobalSettings globalSettings,
                                 IUmbracoContextAccessor umbracoContextAccessor,
                                 ServiceContext serviceContext,
                                 AppCaches appCaches,
                                 IProfilingLogger profilingLogger,
                                 UmbracoHelper umbracoHelper,
                                 ITeamDataSource teamDataSource,
                                 IMatchFilterFactory matchFilterFactory,
                                 IMatchListingDataSource matchDataSource,
                                 IDateTimeFormatter dateFormatter,
                                 ICreateMatchSeasonSelector createMatchSeasonSelector,
                                 IAuthorizationPolicy <Team> authorizationPolicy,
                                 IMatchFilterQueryStringParser matchFilterQueryStringParser,
                                 IMatchFilterHumanizer matchFilterHumanizer)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _teamDataSource               = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource));
     _matchFilterFactory           = matchFilterFactory ?? throw new ArgumentNullException(nameof(matchFilterFactory));
     _matchDataSource              = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _dateFormatter                = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter));
     _createMatchSeasonSelector    = createMatchSeasonSelector ?? throw new ArgumentNullException(nameof(createMatchSeasonSelector));
     _authorizationPolicy          = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _matchFilterQueryStringParser = matchFilterQueryStringParser ?? throw new ArgumentNullException(nameof(matchFilterQueryStringParser));
     _matchFilterHumanizer         = matchFilterHumanizer ?? throw new ArgumentNullException(nameof(matchFilterHumanizer));
 }
コード例 #3
0
 public MatchesController(IGlobalSettings globalSettings,
                          IUmbracoContextAccessor umbracoContextAccessor,
                          ServiceContext serviceContext,
                          AppCaches appCaches,
                          IProfilingLogger profilingLogger,
                          UmbracoHelper umbracoHelper,
                          IMatchListingDataSource matchesDataSource,
                          IDateTimeFormatter dateTimeFormatter,
                          IMatchFilterQueryStringParser matchFilterQueryStringParser,
                          IMatchFilterHumanizer matchFilterHumanizer)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchesDataSource            = matchesDataSource ?? throw new ArgumentNullException(nameof(matchesDataSource));
     _dateTimeFormatter            = dateTimeFormatter ?? throw new ArgumentNullException(nameof(dateTimeFormatter));
     _matchFilterQueryStringParser = matchFilterQueryStringParser ?? throw new ArgumentNullException(nameof(matchFilterQueryStringParser));
     _matchFilterHumanizer         = matchFilterHumanizer ?? throw new ArgumentNullException(nameof(matchFilterHumanizer));
 }
コード例 #4
0
            public TestController(IMatchListingDataSource matchesDataSource, IMatchFilterQueryStringParser matchFilterUrlParser, IMatchFilterHumanizer matchFilterHumanizer)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    null,
                    matchesDataSource,
                    Mock.Of <IDateTimeFormatter>(),
                    matchFilterUrlParser,
                    matchFilterHumanizer)
            {
                var request = new Mock <HttpRequestBase>();

                request.SetupGet(x => x.Url).Returns(new Uri("https://example.org"));
                request.SetupGet(x => x.QueryString).Returns(HttpUtility.ParseQueryString(string.Empty));

                var context = new Mock <HttpContextBase>();

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

                ControllerContext = new ControllerContext(context.Object, new RouteData(), this);
            }
コード例 #5
0
            public TestController(IMatchListingDataSource matchDataSource, IMatchesRssQueryStringParser queryStringParser, IMatchFilterHumanizer matchFilterHumanizer, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    Mock.Of <IClubDataSource>(),
                    Mock.Of <ITeamDataSource>(),
                    Mock.Of <ICompetitionDataSource>(),
                    Mock.Of <IMatchLocationDataSource>(),
                    matchDataSource,
                    Mock.Of <IDateTimeFormatter>(),
                    queryStringParser,
                    matchFilterHumanizer)
            {
                var request = new Mock <HttpRequestBase>();

                request.SetupGet(x => x.Url).Returns(new Uri("https://example.org"));
                request.SetupGet(x => x.RawUrl).Returns("/matches.rss");
                request.SetupGet(x => x.QueryString).Returns(HttpUtility.ParseQueryString(string.Empty));

                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;
            }