Пример #1
0
        public void To_and_from_properties_should_be_set_for_strings()
        {
            var validator = RangeValidatorFactory.CreateInclusiveBetween <Person, string>("a", "c");

            validator.From.ShouldEqual("a");
            validator.To.ShouldEqual("c");
        }
Пример #2
0
        public void To_and_from_properties_should_be_set()
        {
            var validator = RangeValidatorFactory.CreateInclusiveBetween <Person, int>(1, 10);

            validator.From.ShouldEqual(1);
            validator.To.ShouldEqual(10);
        }
Пример #3
0
 public void When_the_to_is_smaller_than_the_from_then_the_validator_should_throw_for_strings()
 {
     typeof(ArgumentOutOfRangeException).ShouldBeThrownBy(() => RangeValidatorFactory.CreateInclusiveBetween <Person, string>("ccc", "aaa"));
 }