public void StringMinLength() { var schema = new SimpleTypeSchema("Currency", typeof(string)) .SetStringMinLength(3); schema.GetStringMinLength() !.MinLength.Should().Be(3); Property <string> currency = new Property <string>("Currency") .SetSchema(schema); var validationRules = ValidationProvider.Instance.GetValidationRules(currency).ToList(); validationRules.Should().HaveCount(1); var messages = new MutablePropertyContainer() .WithValue(currency, "USD") .Validate(validationRules) .ToList(); messages.Should().BeEmpty(); messages = new MutablePropertyContainer() .WithValue(currency, "a") .Validate(validationRules) .ToList(); messages[0].FormattedMessage.Should().Be("Value 'a' is too short (length: 1, minLength: 3)"); }