示例#1
0
 public ForumController(IForumService service, IPrincipal principal, IFileUploadService fileService, IConfigSettingsService configServices, IProfanityService profService)
 {
     _service        = service;
     _principal      = principal;
     _fileService    = fileService;
     _configServices = configServices;
     _profService    = profService;
 }
示例#2
0
 public AnswerController(IAnswerService answerService, IProfanityService profanityService, ISuggestionService suggestionService,
                         IUserService userService, IAntiforgery antiforgery, IStatisticsService statisticsService)
 {
     _answerService     = answerService;
     _profanityService  = profanityService;
     _suggestionService = suggestionService;
     _userService       = userService;
     _antiforgery       = antiforgery;
     _statisticsService = statisticsService;
 }
        public void Setup()
        {
            var mockMapper = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new AutoMapping());
            });
            var mapper = mockMapper.CreateMapper();

            profanityService = new ProfanityService(new FakeProfanityDb());

            _ctr = new ProfanityController(profanityService, mapper);
        }
 public ProjectController(ICategoryService categoryService, ICommentService commentService, IGeolocationService geolocationService, ILocationService locationService, ILogService logService, IModerationQueueService moderationQueueService, IProjectService projectService, IProfanityService profanityService, SiteSettings siteSettings, IUserService userService, IWebHelper webHelper, IWorkContext workContext)
 {
     _categoryService = categoryService;
     _commentService = commentService;
     _geolocationService = geolocationService;
     _locationService = locationService;
     _logService = logService;
     _moderationQueueService = moderationQueueService;
     _profanityService = profanityService;
     _projectService = projectService;
     _siteSettings = siteSettings;
     _userService = userService;
     _webHelper = webHelper;
     _workContext = workContext;
 }
示例#5
0
 public AnswerActionController(IAnswerDescriptionService answerDescriptionService,
                               IProfanityService profanityService, IAnswerService answerService, IResourcesService resourcesService, IUserService userService,
                               IVoteService voteService, ILoggerFactory loggerFactory, IOptions <AppSettings> appSettings, IStatisticsService statisticsService)
 {
     _userService = userService;
     _answerDescriptionService = answerDescriptionService;
     _profanityService         = profanityService;
     _answerService            = answerService;
     _resourcesService         = resourcesService;
     _voteService       = voteService;
     _appSettings       = appSettings;
     _statisticsService = statisticsService;
     _logger            = loggerFactory.CreateLogger <HomeController>();
     _logger.LogInformation("created AnswerActionController");
 }
 public CreateAnswerController(IAnswerService answerService, IProfanityService profanityService,
                               ISuggestionService suggestionService, IUserService userService, IAntiforgery antiforgery,
                               IStatisticsService statisticsService, IResourcesService resourcesService,
                               ILoggerFactory loggerFactory)
 {
     _answerService     = answerService;
     _profanityService  = profanityService;
     _suggestionService = suggestionService;
     _userService       = userService;
     _antiforgery       = antiforgery;
     _statisticsService = statisticsService;
     _resourcesService  = resourcesService;
     _logger            = loggerFactory.CreateLogger <CreateAnswerController>();
     _logger.LogInformation("created CreateAnswerController");
 }
示例#7
0
 public AccountController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager,
                          IEmailSender emailSender, ISmsSender smsSender, IUserService userService, IProfanityService profanityService,
                          ILoggerFactory loggerFactory, IResourcesService resourcesService, IBlobService blobService,
                          IStatisticsService statisticsService)
 {
     _userManager       = userManager;
     _signInManager     = signInManager;
     _emailSender       = emailSender;
     _smsSender         = smsSender;
     _logger            = loggerFactory.CreateLogger <AccountController>();
     _userService       = userService;
     _profanityService  = profanityService;
     _resourcesService  = resourcesService;
     _blobService       = blobService;
     _statisticsService = statisticsService;
 }
示例#8
0
        /// <summary>
        /// Check answer data received from user for profanity.
        /// Set the error message in the answer object if anything found.
        /// </summary>
        /// <param name="service"></param>
        /// <param name="answer"></param>
        /// <returns>true if profanity found</returns>
        private bool CheckProfanity(IProfanityService service, AddedAnswerDto answer)
        {
            var profanityCheckResult = service.CheckProfanity(answer.Answer.LeftWord);

            if (profanityCheckResult.HasIssues)
            {
                answer.ErrorMessage = profanityCheckResult.ErrorMessage;
                return(true);
            }
            profanityCheckResult = service.CheckProfanity(answer.Answer.RightWord);
            if (profanityCheckResult.HasIssues)
            {
                answer.ErrorMessage = profanityCheckResult.ErrorMessage;
                return(true);
            }
            profanityCheckResult = service.CheckProfanity(answer.Answer.Phrase);
            if (profanityCheckResult.HasIssues)
            {
                answer.ErrorMessage = profanityCheckResult.ErrorMessage;
                return(true);
            }
            return(false);
        }
 public SuggestionController(ISuggestionService suggestionService, IProfanityService profanityService, IAntiforgery antiforgery)
 {
     _suggestionService = suggestionService;
     _profanityService  = profanityService;
     _antiforgery       = antiforgery;
 }
 public ProfanityController(IProfanityService profanityService, IMapper mapper)
 {
     _profanityService = profanityService;
     _mapper           = mapper;
 }
示例#11
0
 public void Setup()
 {
     profanityService = new ProfanityService(new FakeProfanityDb());
 }