Exemple #1
0
        public void RegularExpressionValidator_ValidTheory(string s, string pattern)
        {
            var lessThanOrEqualToValidator = new RegularExpressionValidator <TestValidatableObject>(_ => pattern, ValidationMessageType.Error);
            var context           = new ValidationContext <TestValidatableObject, string>(null, nameof(TestValidatableObject.Number), null, s);
            var validationMessage = lessThanOrEqualToValidator.ValidateProperty(context).FirstOrDefault();

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
        public void EqualValidatorWithComparer_ValidTheory(string value, string valueToCompare)
        {
            var validationMessage = Equal(value, valueToCompare, StringComparer.OrdinalIgnoreCase);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
        public void EqualValidatorProperty_ValidTheory <TProp>(TProp value, TProp valueToCompare)
        {
            var validationMessage = Equal(value, valueToCompare);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
Exemple #4
0
        public void LessThanValidatorWithoutComparer_ValidTheory(string value, string valueToCompare)
        {
            var validationMessage = LessThan(value, valueToCompare);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
Exemple #5
0
        public void LessThanValidator_ValidTheory(int value, int valueToCompare)
        {
            var validationMessage = LessThan(value, valueToCompare);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
Exemple #6
0
        public void BetweenValidatorWithComparer_ValidTheory(string value, string from, string to)
        {
            var validationMessage = Between(value, from, to, StringComparer.Ordinal);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
Exemple #7
0
        public void BetweenValidator_ValidTheory(int value, int from, int to)
        {
            var validationMessage = Between(value, from, to);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
        public void MaxLengthValidator_ValidTheory(string value, int maxLength)
        {
            var validationMessage = MaxLength(value, maxLength);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
        public void ExactLengthValidator_ValidTheory(string value, int length)
        {
            var validationMessage = ExactLength(value, length);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
        public void GreaterThanOrEqualToValidatorWithoutComparer_ValidTheory(string value, string valueToCompare)
        {
            var validationMessage = GreaterThanOrEqualTo(value, valueToCompare);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }
        public void GreaterThanOrEqualToValidator_ValidTheory(int value, int valueToCompare)
        {
            var validationMessage = GreaterThanOrEqualTo(value, valueToCompare);

            AssertValidationMessage.EmptyMessage(validationMessage);
        }