public StateValidatorTests() { context = new TestingContext(); validator = new StateValidator(new UnitOfWork(context)); context.DropData(); SetUpData(); }
public void StateIdValidator() { var validator = _serviceProvider.GetService <IValidator>(); _testLeadEntity.Properties = new IProperty[] { new DefaultProperty(Modules.LeadEntity.Interface.Constants.PropertyKeys.StateKey, "VA") }; var stateId = new StateValidator(); stateId.ValidLead(_testLeadEntity); bool expectedValue = false; var actualValue = validator.ValidLead(_testLeadEntity); Assert.AreEqual(expectedValue, actualValue); }
public ValidationService(IPrimaryContext context) { Context = context; _contactvalidator = new ContactValidator(); _customervalidator = new CustomerValidator(); _userValidator = new UserValidator(context); _customerSourceValidator = new CustomerSourceValidator(context); _serviceAreaValidator = new ServiceAreaValidator(context); _serviceDivisionValidator = new ServiceDivisionValidator(context); _unitTypeValidator = new UnitTypeValidator(context); _stateValidator = new StateValidator(context); _goodsValidator = new GoodsValidator(context); _customerLocationValidator = new CustomerLocationValidator(context); _contractValidator = new ContractValidator(context); _locationServiceValidator = new LocationServiceValidator(context); }
protected override string PropertyValidation(PropertyInfo pi) { return(base.PropertyValidation(pi) ?? StateValidator.Validate(this, pi)); }