C# Class MyTested.AspNetCore.Mvc.Utilities.Validators.AttributesValidator

Validator class containing attributes validation logic.
Mostrar archivo Open project: ivaylokenov/MyTested.AspNetCore.Mvc

Public Methods

Method Description
ValidateAttributes ( IEnumerable attributes, BaseAttributesTestBuilder attributesTestBuilder, string>.Action failedValidationAction ) : void

Validation collection attribute based on attribute test builder.

ValidateNoAttributes ( IEnumerable attributes, string>.Action failedValidationAction ) : void

Validates whether the provided collection of attributes contains zero elements.

ValidateNumberOfAttributes ( IEnumerable attributes, string>.Action failedValidationAction, int withTotalNumberOf = null ) : void

Validates if any attributes are contained in the provided collection of attributes.

Method Details

ValidateAttributes() public static method

Validation collection attribute based on attribute test builder.
public static ValidateAttributes ( IEnumerable attributes, BaseAttributesTestBuilder attributesTestBuilder, string>.Action failedValidationAction ) : void
attributes IEnumerable Collection of attributes to validate.
attributesTestBuilder BaseAttributesTestBuilder Test builder containing attribute specific validation.
failedValidationAction string>.Action Action to call in case of failed validation.
return void

ValidateNoAttributes() public static method

Validates whether the provided collection of attributes contains zero elements.
public static ValidateNoAttributes ( IEnumerable attributes, string>.Action failedValidationAction ) : void
attributes IEnumerable Collection of attributes to validate.
failedValidationAction string>.Action Action to call in case of failed validation.
return void

ValidateNumberOfAttributes() public static method

Validates if any attributes are contained in the provided collection of attributes.
public static ValidateNumberOfAttributes ( IEnumerable attributes, string>.Action failedValidationAction, int withTotalNumberOf = null ) : void
attributes IEnumerable Collection of attributes to validate.
failedValidationAction string>.Action Action to call in case of failed validation.
withTotalNumberOf int Optional parameter specifying the exact number of expected attributes.
return void