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"); }
public void To_and_from_properties_should_be_set_for_dates() { var validator = RangeValidatorFactory.CreateExclusiveBetween <Person, DateTime>(_fromDate, _toDate); validator.From.ShouldEqual(_fromDate); validator.To.ShouldEqual(_toDate); }
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); }
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")); }
public void When_the_to_is_smaller_than_the_from_then_the_validator_should_throw_for_strings() { Assert.Throws <ArgumentOutOfRangeException>(() => RangeValidatorFactory.CreateExclusiveBetween <Person, string>("ccc", "aaa")); }