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;
            }
示例#2
0
            public TestController(IMatchDataSource matchDataSource, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    matchDataSource,
                    Mock.Of <IPlayerDataSource>(),
                    Mock.Of <IPlayerIdentityFinder>(),
                    Mock.Of <ICommentsDataSource <Stoolball.Matches.Match> >(),
                    Mock.Of <IAuthorizationPolicy <Stoolball.Matches.Match> >(),
                    Mock.Of <IDateTimeFormatter>())
            {
                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 TestController(IMatchDataSource matchDataSource, Uri requestUrl, IMatchInningsUrlParser urlParser, UmbracoHelper umbracoHelper)
                : base(
                    Mock.Of <IGlobalSettings>(),
                    Mock.Of <IUmbracoContextAccessor>(),
                    null,
                    AppCaches.NoCache,
                    Mock.Of <IProfilingLogger>(),
                    umbracoHelper,
                    matchDataSource,
                    Mock.Of <IAuthorizationPolicy <Stoolball.Matches.Match> >(),
                    Mock.Of <IDateTimeFormatter>(),
                    urlParser)
            {
                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;
            }
示例#5
0
 public EditCloseOfPlaySurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                         AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IMatchDataSource matchDataSource,
                                         IMatchRepository matchRepository, IAuthorizationPolicy <Match> authorizationPolicy, IDateTimeFormatter dateTimeFormatter, 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));
     _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _dateTimeFormatter   = dateTimeFormatter ?? throw new ArgumentNullException(nameof(dateTimeFormatter));
     _cacheClearer        = cacheClearer ?? throw new ArgumentNullException(nameof(cacheClearer));
 }
 public EditBattingScorecardSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                              AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IMatchDataSource matchDataSource, IMatchRepository matchRepository,
                                              IAuthorizationPolicy <Stoolball.Matches.Match> authorizationPolicy, IDateTimeFormatter dateTimeFormatter, IMatchInningsUrlParser matchInningsUrlParser,
                                              IPlayerInningsScaffolder playerInningsScaffolder, IBowlingFiguresCalculator bowlingFiguresCalculator)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _matchDataSource          = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _matchRepository          = matchRepository ?? throw new ArgumentNullException(nameof(matchRepository));
     _authorizationPolicy      = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _dateTimeFormatter        = dateTimeFormatter ?? throw new ArgumentNullException(nameof(dateTimeFormatter));
     _matchInningsUrlParser    = matchInningsUrlParser ?? throw new ArgumentNullException(nameof(matchInningsUrlParser));
     _playerInningsScaffolder  = playerInningsScaffolder ?? throw new ArgumentNullException(nameof(playerInningsScaffolder));
     _bowlingFiguresCalculator = bowlingFiguresCalculator ?? throw new ArgumentNullException(nameof(bowlingFiguresCalculator));
 }
 public EditStatisticsSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                        AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IDatabaseConnectionFactory databaseConnectionFactory,
                                        IBackgroundTaskTracker taskTracker, IMatchListingDataSource matchListingDataSource, IMatchDataSource matchDataSource, IStatisticsRepository statisticsRepository,
                                        IBowlingFiguresCalculator bowlingFiguresCalculator, IPlayerInMatchStatisticsBuilder playerInMatchStatisticsBuilder, IPlayerIdentityFinder playerIdentityFinder)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _databaseConnectionFactory = databaseConnectionFactory ?? throw new ArgumentNullException(nameof(databaseConnectionFactory));
     _taskTracker                    = taskTracker ?? throw new ArgumentNullException(nameof(taskTracker));
     _matchListingDataSource         = matchListingDataSource ?? throw new ArgumentNullException(nameof(matchListingDataSource));
     _matchDataSource                = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _statisticsRepository           = statisticsRepository ?? throw new ArgumentNullException(nameof(statisticsRepository));
     _bowlingFiguresCalculator       = bowlingFiguresCalculator ?? throw new ArgumentNullException(nameof(bowlingFiguresCalculator));
     _playerInMatchStatisticsBuilder = playerInMatchStatisticsBuilder ?? throw new ArgumentNullException(nameof(playerInMatchStatisticsBuilder));
     _playerIdentityFinder           = playerIdentityFinder ?? throw new ArgumentNullException(nameof(playerIdentityFinder));
 }
示例#8
0
 public MatchActionsController(IGlobalSettings globalSettings,
                               IUmbracoContextAccessor umbracoContextAccessor,
                               ServiceContext serviceContext,
                               AppCaches appCaches,
                               IProfilingLogger profilingLogger,
                               UmbracoHelper umbracoHelper,
                               IMatchDataSource matchDataSource,
                               IAuthorizationPolicy <Match> authorizationPolicy,
                               IDateTimeFormatter dateFormatter)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchDataSource     = matchDataSource ?? throw new System.ArgumentNullException(nameof(matchDataSource));
     _authorizationPolicy = authorizationPolicy ?? throw new System.ArgumentNullException(nameof(authorizationPolicy));
     _dateFormatter       = dateFormatter ?? throw new System.ArgumentNullException(nameof(dateFormatter));
 }
 public EditBattingScorecardController(IGlobalSettings globalSettings,
                                       IUmbracoContextAccessor umbracoContextAccessor,
                                       ServiceContext serviceContext,
                                       AppCaches appCaches,
                                       IProfilingLogger profilingLogger,
                                       UmbracoHelper umbracoHelper,
                                       IMatchDataSource matchDataSource,
                                       IAuthorizationPolicy <Match> authorizationPolicy,
                                       IDateTimeFormatter dateFormatter,
                                       IMatchInningsUrlParser matchInningsUrlParser,
                                       IPlayerInningsScaffolder playerInningsScaffolder)
     : 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));
     _matchInningsUrlParser   = matchInningsUrlParser ?? throw new ArgumentNullException(nameof(matchInningsUrlParser));
     _playerInningsScaffolder = playerInningsScaffolder ?? throw new ArgumentNullException(nameof(playerInningsScaffolder));
 }
示例#10
0
 public EditStartOfPlayController(IGlobalSettings globalSettings,
                                  IUmbracoContextAccessor umbracoContextAccessor,
                                  ServiceContext serviceContext,
                                  AppCaches appCaches,
                                  IProfilingLogger profilingLogger,
                                  UmbracoHelper umbracoHelper,
                                  IMatchDataSource matchDataSource,
                                  ISeasonDataSource seasonDataSource,
                                  IAuthorizationPolicy <Match> authorizationPolicy,
                                  IDateTimeFormatter dateFormatter,
                                  IEditMatchHelper editMatchHelper)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchDataSource     = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _seasonDataSource    = seasonDataSource ?? throw new ArgumentNullException(nameof(seasonDataSource));
     _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _dateFormatter       = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter));
     _editMatchHelper     = editMatchHelper ?? throw new ArgumentNullException(nameof(editMatchHelper));
 }
示例#11
0
 public MatchController(IGlobalSettings globalSettings,
                        IUmbracoContextAccessor umbracoContextAccessor,
                        ServiceContext serviceContext,
                        AppCaches appCaches,
                        IProfilingLogger profilingLogger,
                        UmbracoHelper umbracoHelper,
                        IMatchDataSource matchDataSource,
                        ICommentsDataSource <Match> commentsDataSource,
                        IAuthorizationPolicy <Match> authorizationPolicy,
                        IDateTimeFormatter dateFormatter,
                        IEmailProtector emailProtector,
                        IBadLanguageFilter badLanguageFilter)
     : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper)
 {
     _matchDataSource     = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource));
     _commentsDataSource  = commentsDataSource ?? throw new ArgumentNullException(nameof(commentsDataSource));
     _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy));
     _dateFormatter       = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter));
     _emailProtector      = emailProtector ?? throw new ArgumentNullException(nameof(emailProtector));
     _badLanguageFilter   = badLanguageFilter ?? throw new ArgumentNullException(nameof(badLanguageFilter));
 }