public Verificator(MockBehavior behavior, IErrorFormatter errorFormatter)
        {
            Contract.Requires(errorFormatter != null, "errorFormatter should not be null.");

            _behavior = behavior;
            _errorFormatter = errorFormatter;
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpErrorHandler"/> class.
 /// </summary>
 /// <param name="formatter">Used to format the response using the uncaught exception.</param>
 public HttpErrorHandler(IErrorFormatter formatter)
 {
     if (formatter == null)
     {
         throw new ArgumentNullException("formatter");
     }
     _formatter = formatter;
 }
Пример #3
0
 public UsersController(
     ApiContext context,
     Iserializer serializer,
     IErrorFormatter errorFormatter,
     IConfiguration config,
     UserManager <UserDTO> userManager,
     SignInManager <UserDTO> signInManager) :
     base(context, serializer, errorFormatter)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _jwt           = new JwtService(config);
 }
Пример #4
0
        public void SetErrorFormatter([NotNull] Control control,
                                      [CanBeNull] IErrorFormatter errorFormatter)
        {
            Ensure.ArgumentNotNull(control, "control");
            var changeKind = this.errorFormatters.Modify(control, errorFormatter);

            if (changeKind == ChangeKind.Added)
            {
                control.Validating += this.Validate;
            }
            else if (changeKind == ChangeKind.Removed)
            {
                control.Validating -= this.Validate;
            }
        }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpErrorHandler"/> class.
 /// </summary>
 /// <param name="formatter">Used to format the response using the uncaught exception.</param>
 public HttpErrorHandler(IErrorFormatter formatter)
 {
     if (formatter == null) throw new ArgumentNullException("formatter");
     _formatter = formatter;
 }
Пример #6
0
 public ApiControllerBase(ApiContext context, Iserializer serializer, IErrorFormatter errorFormatter)
 {
     Serializer     = serializer;
     ErrorFormatter = errorFormatter;
     Context        = context;
 }
Пример #7
0
 /// <summary>
 /// Creates a new ErrorDocumentFormatter
 /// </summary>
 /// <param name="errorFormatter"></param>
 /// <param name="metadataFormatter"></param>
 public ErrorDocumentFormatter(IErrorFormatter errorFormatter, IMetadataFormatter metadataFormatter)
 {
     _errorFormatter    = errorFormatter;
     _metadataFormatter = metadataFormatter;
 }
Пример #8
0
 public QuizController(ApiContext context, Iserializer serializer, IErrorFormatter errorFormatter) :
     base(context, serializer, errorFormatter)
 {
 }
Пример #9
0
 public RecommendationController(ApiContext context, Iserializer serializer, IErrorFormatter errorFormatter,
                                 IScoreService scoreService) :
     base(context, serializer, errorFormatter)
 {
     _scoreService = scoreService;
 }
 /// <summary>
 /// Creates a new ErrorDocumentFormatter
 /// </summary>
 /// <param name="errorFormatter"></param>
 /// <param name="metadataFormatter"></param>
 public ErrorDocumentFormatter(IErrorFormatter errorFormatter, IMetadataFormatter metadataFormatter)
 {
     _errorFormatter = errorFormatter;
     _metadataFormatter = metadataFormatter;
 }