public TestController(ITeamDataSource teamDataSource,
                                  IMatchListingDataSource matchDataSource,
                                  ICreateMatchSeasonSelector createMatchSeasonSelector,
                                  IMatchFilterQueryStringParser matchFilterQueryStringParser,
                                  UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    teamDataSource,
                    Mock.Of <IMatchFilterFactory>(),
                    matchDataSource,
                    Mock.Of <IDateTimeFormatter>(),
                    createMatchSeasonSelector,
                    Mock.Of <IAuthorizationPolicy <Team> >(),
                    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 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 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));
 }
 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));
 }
示例#5
0
            public TestController(ITeamDataSource teamDataSource, ISeasonDataSource seasonDataSource, ICreateMatchSeasonSelector createMatchSeasonSelector, IEditMatchHelper editMatchHelper, Uri requestUrl)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    null,
                    teamDataSource,
                    seasonDataSource,
                    createMatchSeasonSelector,
                    editMatchHelper)
            {
                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;
            }