예제 #1
0
        public void ValidateName()
        {
            var errors = _personValidatior.ShouldHaveValidationErrorFor(p => p.Name, null as string);

            Assert.NotEmpty(errors);
            string errorCode = errors.ToList().First(x => x.PropertyName == "Name").ErrorCode;

            Assert.Equal("NotEmptyValidator", errorCode);
        }
예제 #2
0
 public void ShouldReturnErrorIfNoFirstNameEntered()
 {
     _validator.ShouldHaveValidationErrorFor(r => r.FirstName, null as string);
 }