public void ValidateInternationaPhone() { _personValidatior.ShouldNotHaveValidationErrorFor(p => p.PhoneNumber, "+39 045-989898", PersonValidator.ValidaNumeriTelefono); var errors = _personValidatior.ShouldHaveValidationErrorFor(p => p.PhoneNumber, "+39 045989898", PersonValidator.ValidaNumeriTelefono); Assert.NotEmpty(errors); string errorCode = errors.ToList().First().ErrorCode; Assert.Equal("InternationPhoneRule", errorCode); }
public void ShouldNotHaveErrorIfMiddleNameIsEmpty() { _validator.ShouldNotHaveValidationErrorFor(r => r.MiddleName, null as string); }