Ejemplo n.º 1
0
        private TaskErrorCategory TranslateErrorCategory(ValidationErrorSeverity validationErrorSeverity)
        {
            switch (validationErrorSeverity)
            {
                case ValidationErrorSeverity.Error:
                    return TaskErrorCategory.Error;
                case ValidationErrorSeverity.Message:
                    return TaskErrorCategory.Message;
                case ValidationErrorSeverity.Warning:
                    return TaskErrorCategory.Warning;
            }

            return TaskErrorCategory.Error;
        }
 public ValidationError(Span span, string description, ValidationErrorSeverity severity, ValidationErrorType type)
     : this(span, description)
 {
     Severity = severity;
     Type = type;
 }
Ejemplo n.º 3
0
        public void IsValidReturnsTrueWhenSeverityIsEqual(ValidationErrorSeverity severity, ValidationErrorSeverity testedSeverity)
        {
            ValidationResult result = ValidationResultFactory.Create(severity);

            result.IsValid(testedSeverity)
            .Should()
            .BeTrue();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// ValidationError constructor that assumes the error has a type of 'Row'.
 /// </summary>
 /// <param name="RowPosition">Position of the file row that generated the error.</param>
 /// <param name="Message">Message describing the error.</param>
 /// <param name="ValidationErrorSeverity">Indicates whether the error is critical.  Defaults to 'true'.</param>
 public ValidationError(int RowPosition, string RowDisposition, string Message, ValidationErrorSeverity Severity = ValidationErrorSeverity.Critical)
 {
     this.Scope          = ValidationErrorScope.Row;
     this.RowPosition    = RowPosition;
     this.RowDisposition = RowDisposition;
     this.Message        = Message;
     this.Severity       = Severity;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// ValidationError constructor that assumes the error has a type of 'File'.
 /// </summary>
 /// <param name="Message">Message describing the error.</param>
 /// <param name="ValidationErrorSeverity">Indicates whether the error is critical.  Defaults to 'true'.</param>
 public ValidationError(string Message, ValidationErrorSeverity Severity = ValidationErrorSeverity.Critical)
 {
     this.Scope    = ValidationErrorScope.File;
     this.Message  = Message;
     this.Severity = Severity;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// ValidationError constructor that assumes the error has a type of 'Column'.
 /// </summary>
 /// <param name="ColumnPosition">Position of the column that generated the error.</param>
 /// <param name="ColumnLabel">Label of the column that generated the error.</param>
 /// <param name="RowPosition">Position of the file row that generated the error.</param>
 /// <param name="Message">Message describing the error.</param>
 /// <param name="ValidationErrorSeverity">Indicates whether the error is critical.  Defaults to Critical.</param>
 public ValidationError(int RowPosition, string RowDisposition, int ColumnPosition, string ColumnLabel, string Message, ValidationErrorSeverity Severity = ValidationErrorSeverity.Critical)
 {
     this.Scope          = ValidationErrorScope.Column;
     this.RowPosition    = RowPosition;
     this.RowDisposition = RowDisposition;
     this.ColumnLabel    = ColumnLabel;
     this.ColumnPosition = ColumnPosition;
     this.Message        = Message;
     this.Severity       = Severity;
 }