Example #1
0
        public void Pass_if_the_value_is_not_empty()
        {
            NotEmptyExampleWithString example = new NotEmptyExampleWithString();

             example.String = "something";

             IList<ValidatonError> messages =
            _validator.Validate(new object[1] { example }, new Dictionary<string, IValidationAware>()).Errors;

             Assert.AreEqual(0, messages.Count);
        }
Example #2
0
        public void Fail_if_the_value_is_null()
        {
            NotEmptyExampleWithString example = new NotEmptyExampleWithString();

             example.String = null;

             IList<ValidatonError> messages =
            _validator.Validate(new object[1] { example }, new Dictionary<string, IValidationAware>()).Errors;

             Assert.AreEqual(1, messages.Count);
        }