public TournamentController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ServiceContext serviceContext, AppCaches appCaches, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, ITournamentDataSource tournamentDataSource, IMatchListingDataSource matchDataSource, IMatchFilterFactory matchFilterFactory, ICommentsDataSource <Tournament> commentsDataSource, IAuthorizationPolicy <Tournament> authorizationPolicy, IDateTimeFormatter dateFormatter, IEmailProtector emailProtector, IBadLanguageFilter badLanguageFilter) : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper) { _tournamentDataSource = tournamentDataSource ?? throw new ArgumentNullException(nameof(tournamentDataSource)); _matchDataSource = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource)); _matchFilterFactory = matchFilterFactory ?? throw new ArgumentNullException(nameof(matchFilterFactory)); _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)); }
public TestController(IMatchDataSource matchDataSource, ICommentsDataSource <Stoolball.Matches.Match> commentsDataSource, UmbracoHelper umbracoHelper) : base( Mock.Of <IGlobalSettings>(), Mock.Of <IUmbracoContextAccessor>(), null, AppCaches.NoCache, Mock.Of <IProfilingLogger>(), umbracoHelper, matchDataSource, commentsDataSource, Mock.Of <IAuthorizationPolicy <Stoolball.Matches.Match> >(), Mock.Of <IDateTimeFormatter>(), Mock.Of <IEmailProtector>(), Mock.Of <IBadLanguageFilter>()) { 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 DeleteMatchSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext, AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IMatchDataSource matchDataSource, IMatchRepository matchRepository, ICommentsDataSource <Match> matchCommentsDataSource, 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)); _matchCommentsDataSource = matchCommentsDataSource ?? throw new ArgumentNullException(nameof(matchCommentsDataSource)); _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); _dateTimeFormatter = dateTimeFormatter ?? throw new ArgumentNullException(nameof(dateTimeFormatter)); _cacheClearer = cacheClearer ?? throw new ArgumentNullException(nameof(cacheClearer)); }
public DeleteTournamentController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ServiceContext serviceContext, AppCaches appCaches, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, ITournamentDataSource tournamentDataSource, IMatchListingDataSource matchDataSource, ICommentsDataSource <Tournament> tournamentCommentsDataSource, IAuthorizationPolicy <Tournament> authorizationPolicy, IDateTimeFormatter dateFormatter) : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper) { _tournamentDataSource = tournamentDataSource ?? throw new System.ArgumentNullException(nameof(tournamentDataSource)); _matchDataSource = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource)); _tournamentCommentsDataSource = tournamentCommentsDataSource; _authorizationPolicy = authorizationPolicy; _dateFormatter = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter)); }
public DeleteMatchController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ServiceContext serviceContext, AppCaches appCaches, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IMatchDataSource matchDataSource, IPlayerDataSource playerDataSource, IPlayerIdentityFinder playerIdentityFinder, ICommentsDataSource <Match> matchCommentsDataSource, IAuthorizationPolicy <Match> authorizationPolicy, IDateTimeFormatter dateFormatter) : base(globalSettings, umbracoContextAccessor, serviceContext, appCaches, profilingLogger, umbracoHelper) { _matchDataSource = matchDataSource ?? throw new System.ArgumentNullException(nameof(matchDataSource)); _playerDataSource = playerDataSource ?? throw new ArgumentNullException(nameof(playerDataSource)); _playerIdentityFinder = playerIdentityFinder ?? throw new ArgumentNullException(nameof(playerIdentityFinder)); _matchCommentsDataSource = matchCommentsDataSource ?? throw new ArgumentNullException(nameof(matchCommentsDataSource)); _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); _dateFormatter = dateFormatter ?? throw new ArgumentNullException(nameof(dateFormatter)); }