Exemplo n.º 1
0
        public void Pass_when_the_value_is_not_empty()
        {
            NotEmptyExampleWithGuid example = new NotEmptyExampleWithGuid();
             example.Guid = Guid.NewGuid();

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

             Assert.AreEqual(0, messages.Count);
        }
Exemplo n.º 2
0
        public void Fail_when_the_value_equals_an_empty_guid()
        {
            NotEmptyExampleWithGuid example = new NotEmptyExampleWithGuid();
             example.Guid = Guid.Empty;

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

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